Re: <> operator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: <> operator
Date: 2006-03-03 14:38:04
Message-ID: 276.1141396684@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Jonah H. Harris 2006-03-03 20:01:50 Re: INS/UPD/DEL RETURNING for 8.2
Previous Message Qingqing Zhou 2006-03-03 06:50:32 Re: <> operator