Re: [GENERAL] function returning setof..select versus select * from

2008-10-06 Thread Tom Lane
Jeff Amiel <[EMAIL PROTECTED]> writes: > What is the difference between: > select foo(); > and > select * from foo(); They're implemented differently, partly for legacy or lack-of-round-tuit reasons, and partly because different PLs prefer different strategies for returning sets. The first form o

[GENERAL] function returning setof..select versus select * from

2008-10-06 Thread Jeff Amiel
What is the difference between: select foo(); and select * from foo(); Foo is defined as: CREATE OR REPLACE FUNCTION foo() RETURNS SETOF integer AS 'SELECT column from foo_table;' LANGUAGE 'sql' STABLE; Explain shows difference... explain select * from foo() "Function Scan on foo (cos

[GENERAL] function returning setof..select versus select * from

2008-10-02 Thread Jeff Amiel
What is the difference between: select foo(); and select * from foo(); Foo is defined as: CREATE OR REPLACE FUNCTION foo() RETURNS SETOF integer AS 'SELECT column from foo_table;' LANGUAGE 'sql' STABLE; Explain shows difference... explain select * from foo() "Function Scan on foo (cos