"Rodolfo Campero" <rodolfo.camp...@anachronics.com> writes: > I stumbled upon a weird behavior of postgresql, I don't know if it's a bug > or not, but I find it counterintuitive: when then last statement of a SQL > function is a SELECT statement with calls another function, the call is > executed only once, regardless of the number of rows returned by the FROM > clause.
Yeah, it stops as soon as it's got the one row needed for the function result. You might consider marking the function as returning SETOF if you want the final select executed to completion. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs