On 17/02/11 01:10, Robert Haas wrote: > If you do SELECT function_with_one_out_parameter() rather than SELECT > * FROM function_with_one_out_parameter(), you'll get just one > argument. Does that help at all?
Unfortunately, not really, because it doesn't work for cases where there's more than one OUT parameter (if you use the SELECT f() form in that case, you get one gigantic result column, not one column per OUT parameter) I dug into the code and it's actually slightly different to what I originally described. Currently given a JDBC escape of the form "{ call f(?,?,?,?) }" it will rewrite that to: "SELECT * FROM f($1,$2,$3,$4) AS RESULT" and this rewriting happens before we know which parameters are bound as OUT parameters. So we can't special-case the one-OUT-parameter case without quite a rewrite (no pun intended). Once we get to the point of query execution, we know which parameters are OUT parameters, and we bind void parameter values to those (v3 protocol). You have to do a PREPARE/EXECUTE to pass in void parameter types to get the equivalent via psql, as far as I can tell. Anyway, it's a bit counterintuitive that SELECT * FROM f($1,$2) AS RESULT where f() takes two OUT parameters always returns two columns, but SELECT * FROM f($1) AS RESULT might return any number of columns! Is that really the correct behavior here? Oliver -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers