James Robinson <jlrobins@socialserve.com> writes:
> Diving in, I see that Postgres's PREPARE statement needs the types
> up-front, as in:
> PREPARE t_prep (TEXT) as select id from users where name = $1;
Yes, but that is not the facility you want to use. The facility that
was specifically designed to support JDBC is the V3-protocol prepare/
bind/execute message group. That stuff can push back inferred parameter
types, which is what I think you are looking for. See
http://www.postgresql.org/docs/7.4/static/protocol.html
particularly
http://www.postgresql.org/docs/7.4/static/protocol-flow.html#AEN52666
There's also a bunch of discussion in the mail list archives from about
a year ago.
regards, tom lane