Re: Weird ..... (a=1 or a=2) <> (a=2 or a=1)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rafael Martinez, Guerrero" <r(dot)m(dot)guerrero(at)usit(dot)uio(dot)no>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Weird ..... (a=1 or a=2) <> (a=2 or a=1)
Date: 2006-05-16 15:14:21
Message-ID: 12469.1147792461@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Rafael Martinez, Guerrero" <r(dot)m(dot)guerrero(at)usit(dot)uio(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2006-05-16 15:20:23 Re: FW: Getting information about sequences
Previous Message Forums @ Existanze 2006-05-16 14:51:20 Re: FW: Getting information about sequences

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-05-16 15:53:42 Re: Compression and on-disk sorting
Previous Message Cristiano Duarte 2006-05-16 14:47:25 Re: [BUGS] BUG #2429: Explain does not report object's schema