Re: [HACKERS] indexes and floats - Mailing list pgsql-hackers

From dg@informix.com (David Gould)
Subject Re: [HACKERS] indexes and floats
Date
Msg-id 9808070606.AA19690@hawk.illustra.com
Whole thread Raw
In response to Re: [HACKERS] indexes and floats  (Vadim Mikheev <vadim@krs.ru>)
List pgsql-hackers
Vadim writes:
> Imho, we have to treat random() etc differently in target list and
> qual! WHERE defines set of rows to be returned by query, functions
> in target list define representation of this set.

Maybe, but it sure makes the system harder to explain. For example, what
happens to a function in the target list of a subquery select? And what
should happen.

But, perhaps we should just do whatever is easiest since anyone who writes
a query:

 select * from x where x.key = random();

probably deserves whatever they get ;-)

Seriously, I have never seen random used in a where clause. And I don't think
that queries like

 select * from events where event.time = timenow();

make a lot of sense either. How did event.time get to be _equal_ to the
current time. Given that it had to be inserted earlier and the time of
the select would not have been known then.

My point is anyone who uses a variant function in a where clause already
is pretty confused. To tell them that variant functions aren't variant when
used in where clauses probably will just confuse them more.

-dg


David Gould            dg@illustra.com           510.628.3783 or 510.305.9468
Informix Software  (No, really)         300 Lakeside Drive  Oakland, CA 94612
 - If simplicity worked, the world would be overrun with insects. -

pgsql-hackers by date:

Previous
From: dg@informix.com (David Gould)
Date:
Subject: Re: [HACKERS] indexes and floats
Next
From: "Sergey E. Levov"
Date:
Subject: Re: [HACKERS] SPI procedure for removing large objects