On Monday, October 28, 2002, at 09:50 AM, Rudy Lippan wrote:
My Guess it was that the since the bin col needed
\\\\, that quote() escaped the the data, and the eacaping (in
non-binary
mode) in execute escaped the escaped the \, so that it inserted
correctly
(save for for the doubling of the quotes).
Yes, that was my guess, too. But since ' shouldn't be double-escaped
with \\\\, I would say that quote() doesn't work with binary data.
How do you plan for DBD::Pg to know? Unless libpq will give you the
data
you need to make this decision, I don't see this as an option.
We could use the introspection methods to do this. DBD::Pg already does
this for fetches.
How *should* it be implemented:
How about a libpq() prepare function that would parse the statement,
store
the execution plan, and return a list of column types to the DBD::Pg so
that when execute was called DBD::Pg would know how to bind the
columns.
I have not been folowing the PostgreSQL mailing lists, so I do not know
know if a prepare() is ever going to be.
Yes, this would rock -- especially if we added support for prepared
statements (a new feature in PostgreSQL 7.3, which is now in its third
beta release).
If you use the same escapes for string data as you use for binary data,
will you not have to worry about the quadrupling of the \'s within the
strings ?
Yes -- see my post from yesterday on this issue.
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]