Re: [PERFORM] Repeat execution of stable expressions

2012-03-06 Thread Merlin Moncure
On Tue, Mar 6, 2012 at 10:21 AM, Jan Otto wrote: > hi, > >> I've complained many times that >> select (f()).*; >> >> will execute f() once for each returned field of f() since the server >> essentially expands that into: >> >> select f().a, f().b; >> >> try it yourself, see: >> create function f(a

Re: [PERFORM] Repeat execution of stable expressions

2012-03-06 Thread Jan Otto
hi, > I've complained many times that > select (f()).*; > > will execute f() once for each returned field of f() since the server > essentially expands that into: > > select f().a, f().b; > > try it yourself, see: > create function f(a out text, b out text) returns record as $$ > begin > perfo

Re: [PERFORM] Repeat execution of stable expressions

2012-03-06 Thread Merlin Moncure
On Mon, Mar 5, 2012 at 6:41 PM, Peter van Hardenberg wrote: > On Mon, Mar 5, 2012 at 3:15 PM, Merlin Moncure wrote: >> I've complained many times that >> select (f()).*; >> >> will execute f() once for each returned field of f() since the server >> essentially expands that into: >> >> select f().

Re: [PERFORM] Repeat execution of stable expressions

2012-03-05 Thread Peter van Hardenberg
On Mon, Mar 5, 2012 at 3:15 PM, Merlin Moncure wrote: > I've complained many times that > select (f()).*; > > will execute f() once for each returned field of f() since the server > essentially expands that into: > > select f().a, f().b; > oh, this is why we expand rows inside a WITH statement.

[PERFORM] Repeat execution of stable expressions

2012-03-05 Thread Merlin Moncure
I've complained many times that select (f()).*; will execute f() once for each returned field of f() since the server essentially expands that into: select f().a, f().b; try it yourself, see: create function f(a out text, b out text) returns record as $$ begin perform pg_sleep(1); a := 'a';