David Johnston <polobo@xxxxxxxxx> writes: > On Feb 16, 2012, at 14:19, Jack Christensen <jackc@xxxxxxxxxxxxxxxxx> wrote: >> Can someone explain how set returning functions in a select clause work? > You apparently just did...it CROSS JOINs except in the special case where multiple functions each return the same number of records (generally due to them all operating on the same sized input - like unnest(array) - in which case it synchronizes the generated rows. I believe the number of rows you get is the least common multiple of the lengths of the SRF results. This behavior is widely disliked, but we're unlikely to change it for fear of breaking working apps. The long-term plan is to implement LATERAL in FROM and then deprecate using SRFs in target lists altogether. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general