On Tuesday, October 29, 2002, at 02:50 AM, Tim Bunce wrote:

> Beware that your semantics for SQL_BINARY must match those of ODBC.
> I think ODBC requires SQL_BINARY values to be formated as pairs of
> hex chars.
>
> Best to use bind_param($col, $val, { pg_type => NNN })
> where NNN is the value of the PostgreSQL bytea type.

Looking at this again, I find that the code already does this, after a fashion. If you use bind_param($col, $val, { pg_type => 17 }) (where 17 represents the PostgreSQL BYTEA type), then it does the proper escaping. The thing is, if you use bind_param($col, $val, { pg_type => SQL_BINARY }), instead, then DBD::Pg uses its internal sql_pg_type() function to convert SQL_BINARY to 17 -- even though, according to what you say above, Tim, they're not strictly speaking the same thing.

We can do two things about this. We can either remove this translation bit, so that SQL_BINARY doesn't become BYTEA. Then anyone who is binding SQL_BINARY will have to change it. Or we can document that it's *going* to change in the next version -- and maybe throw a warning -- and put it off till the next version.

Thoughts?

David

--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]

Reply via email to