Re: Three types of functions, ala function redux.

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Three types of functions, ala function redux.
Date: 2000-12-19 19:19:16
Message-ID: Pine.BSF.4.21.0012191056140.77089-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2000-12-19 19:25:21 Re: Who is a maintainer of GiST code ?
Previous Message Joseph 2000-12-19 18:56:33 Help me for "DBI->connect failed: Sorry, too many clients already."