Re: Three types of functions, ala function redux. - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: Three types of functions, ala function redux.
Date
Msg-id Pine.BSF.4.21.0012191056140.77089-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Three types of functions, ala function redux.  (mlw <markw@mohawksoft.com>)
List pgsql-hackers
[I was having trouble with the direct address so i'm only sending to
the list]

> select * from table where col = function() ;

> (2) "function()" returns a number of values that are independent of the
> query. Postgres should be able to optimize this to be: "select * from
> table where col in (val1, val2, val3, ..valn)." I guess Postgres can
> loop until done, using the isDone flag?

I disagree here.  I really don't think that changing = to mean "in"
in the system is a good idea.  If the user wants an in they should 
specify it.
I think "select * from table where col in (select function());" or
"select * from table where col in (select * from function());" or
even "select * from table where col in function();"
are better ways of specifying this sort of behavior.

If we do that (col = <function returning set>) meaning in, then does
col = (select statement that returns multiple rows) mean in and what
about col = <array>?  I think doing it only for the function case is
a mistake.



pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Sample databases?
Next
From: Oleg Bartunov
Date:
Subject: Re: Who is a maintainer of GiST code ?