"Fernando Hevia" <[EMAIL PROTECTED]> writes:
> -- In this case function test is called only once:
> pg=# select res[0] as sum, res[1] as prod, res[2] as dif from
> pg-# (select (test(1, 2))::integer[] as res) t ;

That's an implementation artifact, not a guaranteed behavior;
if you change the example a bit you'll find multiple calls
happening.

(In recent releases you'd actually have a better chance of
not having multiple calls if you'd declared it volatile
instead of immutable.)

                        regards, tom lane

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to