Re: DBD::Pg BYTEA Character Escaping - Mailing list pgsql-general

From David Wheeler
Subject Re: DBD::Pg BYTEA Character Escaping
Date
Msg-id 1006118491.729.4.camel@mercury.atomicode.com
Whole thread Raw
In response to Re: DBD::Pg BYTEA Character Escaping  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: DBD::Pg BYTEA Character Escaping
List pgsql-general
On Sat, 2001-11-17 at 21:46, Tom Lane wrote:

> Offhand I don't think you even need the check on the datatype; wouldn't
> it be faster and safer to do the substitution unconditionally?  I can't
> see that there are any cases that work without this substitution and
> fail with it.

In that case, I suggest the attached, even more simplified patch. It
assumes that the quote character stored in $lp in the existing version
is always "'" (a safe assumption for DBD:Pg, I think, in a way it wasn't
for DBI, from whence the code for the LITERAL_PREFIX and LITERAL_SUFFIX
was copied into DBD::Pg), and therefore performs the escaping of the
three agreed-upon characters for all non-numeric data types.

If you agree that this tack makes sense, I'll submit the patch to Edmund
Mergl.

Regards,

Daviid

--
David Wheeler                                     AIM: dwTheory
David@Wheeler.net                                 ICQ: 15726394
                                               Yahoo!: dew7e
                                               Jabber: Theory@jabber.org

Attachment

pgsql-general by date:

Previous
From: Sharon Cowling
Date:
Subject: Problem with type in rule
Next
From: David Wheeler
Date:
Subject: Re: DBD::Pg BYTEA Character Escaping