Re: <> operator - Mailing list pgsql-patches

From Tom Lane
Subject Re: <> operator
Date
Msg-id 276.1141396684@sss.pgh.pa.us
Whole thread Raw
In response to Re: <> operator  ("Qingqing Zhou" <zhouqq@cs.toronto.edu>)
List pgsql-patches
"Qingqing Zhou" <zhouqq@cs.toronto.edu> writes:
> There might be another usage of tid < or >. Consider a heap with one middle
> page is broken, I could save most of my data by doing
> INSERT INTO aa SELECT * FROM a WHERE ctid < '(1000, 1)';
> INSERT INTO aa SELECT * FROM a WHERE ctid > '(1001, 0)';

Well, not really, because the planner won't optimize that, hence will
try to apply the WHERE condition to each row of the table, hence you'll
still bomb on the bad page.

> The above example also proves that <= or >= is not required.

<> is "not required" either since NOT (foo = bar) serves perfectly well.
If we're going to do this I'd vote for putting in all four operators
just to minimize the surprise factor.  But I'm not sold that there's
a use case, any more than Neil is.

            regards, tom lane

pgsql-patches by date:

Previous
From: "Qingqing Zhou"
Date:
Subject: Re: <> operator
Next
From: "Jonah H. Harris"
Date:
Subject: Re: INS/UPD/DEL RETURNING for 8.2