Re: Functions returning sets - Mailing list pgsql-hackers

From Don Baccus
Subject Re: Functions returning sets
Date
Msg-id 3.0.1.32.20010520112900.01728e10@mail.pacifier.com
Whole thread Raw
In response to Re: Functions returning sets  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Functions returning sets  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-hackers
At 10:55 AM 5/20/01 -0700, Stephan Szabo wrote:
> Can the IN always get written as a
>join and is it always better to do so?

Nope:

openacs4=# select 1 in (1,2,3);?column? 
----------t
(1 row)

You might also do something like

"select count(*) from foo where foo.state in ('rejected', 'banned');"

A better question, I guess, is if it is always better to write
it as a join if the left hand operand is a table column and
the right hand operand a rowset.





- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Functions returning sets
Next
From: Stephan Szabo
Date:
Subject: Re: Functions returning sets