[Libpqxx-general] Prepared statements parameters inconsistency
Trigve Siver
trigves at yahoo.com
Tue Jul 14 15:05:03 UTC 2009
Thanks for reply,
> From: Jeroen T. Vermeulen <jtv at xs4all.nl>
> To: Trigve Siver <trigves at yahoo.com>
> Cc: libpqxx-general at pgfoundry.org
> Sent: Tuesday, July 14, 2009 4:49:38 PM
> Subject: Re: [Libpqxx-general] Prepared statements parameters inconsistency
>
> It must be something about how postgres guesses what the parameters are.
> On up-to-date libpq and backends at least, libpqxx relies entirely on that
> guess and ignores the parameter types you declare.
Yes I've tried to trace down the problem and the libpq "parameters guessing" is showing the error as you say.
> We could change that, but it's probably going to uncover a whole load of
> bugs in client programs. We might even need a "second-guess" approach
> where both are tried...
Maybe some new parameter could be added to "prepare" function signaling if we want paramater guessing or not (But there could be some other problems with custom types where Oid's are known only in backend). Anyway workaround for this is explicit type casting like "UPDATE customer SET id = $1::VAARCHAR, id_sub = $2::VARCHAR WHERE (id = $1 AND id_sub = $2)".
> Jeroen
Trigve
More information about the Libpqxx-general
mailing list