On Tue, 29 Oct 2002 09:37:18 -0800, David Wheeler wrote:
> 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.
>
> Hex? Hrm. Quoting from DBD::Pg's dbdimp.c:
>
> dest+=snprintf(dest, strlen(imp_sth->statement) + max_len +
> (statement - dest), "\\\\%03o", *((unsigned char *)val));
>
> That looks to me like it's using octal characters. Is this wrong, then?
> This approach, BTW, is what the bytea data type understands, not hex.
That's what the driver has to pass to Postgres. However SQL_BINARY says that
what gets passed to the driver is hex encoded. This means that if the user
specifies SQL_BINARY, the correct approach for the driver would be to decode
the hex, and recode as octal.
--
Peter Haworth [EMAIL PROTECTED]
"Stinginess with privileges is kindness in disguise."
-- Guide to VAX/VMS Security, Sep. 1984