Re: Weird ..... (a=1 or a=2) <> (a=2 or a=1) - Mailing list pgsql-general

From Tom Lane
Subject Re: Weird ..... (a=1 or a=2) <> (a=2 or a=1)
Date
Msg-id 12469.1147792461@sss.pgh.pa.us
Whole thread Raw
In response to Weird ..... (a=1 or a=2) <> (a=2 or a=1)  ("Rafael Martinez, Guerrero" <r.m.guerrero@usit.uio.no>)
Responses Re: Weird ..... (a=1 or a=2) <> (a=2 or a=1)
List pgsql-general
"Rafael Martinez, Guerrero" <r.m.guerrero@usit.uio.no> writes:
> I have found out the sql statement with 'problems'. Can anybody explain
> me why A) returns 12 rows and B) returns 13 rows?. The only different is
> the "open OR new" / "new OR open" part. Should not they return the samme
> result?

That is ... simply bizarre.  Could we see all the system columns for the
rows in question, ie
    select ctid,oid,xmin,xmax,cmin,cmax, id,effectiveid, ...
        (the rest as in your second query that gets all the rows)
Leave out "oid" if you have the table made without oids.

I suspect this may be a question of a corrupt index, in which case
REINDEXing the index being used would fix it.  But before you try that,
please save a physical copy of the index file (immediately after doing a
CHECKPOINT, if the database is being actively modified).  I would like
to dig through it and try to understand the nature of the corruption,
if that's what the problem is.

            regards, tom lane

pgsql-general by date:

Previous
From: "Forums @ Existanze"
Date:
Subject: Re: FW: Getting information about sequences
Next
From: "Joshua D. Drake"
Date:
Subject: Re: FW: Getting information about sequences