Re: Fwd: [JDBC] Weird issues when reading UDT from stored function
Lukas Eder <lukas.eder@gmail.com>
From: Lukas Eder <lukas.eder@gmail.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: rsmogura <rsmogura@softperience.eu>, Florian Pflug <fgp@phlo.org>, Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, pgsql-jdbc@postgresql.org, pgsql-hackers@postgresql.org
Date: 2011-02-17T17:31:04Z
Lists: pgsql-hackers
Hi Oliver There are two problems. > > The first problem is a plpgsql problem in that particular function. It's > broken regardless of how you call it. Here's how to fix it [...] > Thanks for insisting! I missed that fact. In the end, it looked like the same error, but you're right about the plpgsql syntax error. > The second problem is that the JDBC driver always generates calls in the > "SELECT * FROM ..." form, but this does not work correctly for > one-OUT-parameter-that-is-a-UDT, as seen in the example immediately > above. Here's how to do the call for that particular case [...] > Knowing these things, I think I can live with the status quo in my case. As I'm writing a database abstraction library (http://jooq.sourceforge.net), with generated source code, I can hide these Postgres-specific details from end-user code easily and assemble the UDT myself when reading the 6 return values. > Any questions? (I'm sure there will be questions. Sigh.) > Thanks again for the patience! :-)