Viktor The quick and dirty method would be to pass the subquery as a string, then execute the subquery in the function.
Will T -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general