On Mar 23, 2006, at 9:50 PM, Greg Sabino Mullane wrote:
>> OK. Here is my follow-up question. Why is this explicit
>> parameter binding
>> necessary? When would I want to have pg_type be something other than
>> PG_BYTEA when inserting into a bytea column?
>
> You wouldn't, but the trick is getting all the pieces to know that
> the column
> is bytea. DBD::Pg has no inherent way to find out for iteslf. Nor
> does libpq.
> The planner has an idea, but that information is not transmitted
> back to DBD:Pg.
I have not looked at libpq in any detail, but it should have access
to the type of all the parameters in the prepared statement. The
Describe (F) statement in the frontend/backend protocol identifies
the type of each parameter. I'm using this in Lisp to convert
parameters as needed for prepared statements.
http://www.postgresql.org/docs/8.1/static/protocol-message-formats.html
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL