Re: DBD::Pg BYTEA Character Escaping

From: David Wheeler <david(at)wheeler(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: DBD::Pg BYTEA Character Escaping
Date: 2001-11-18 21:21:30
Message-ID: 1006118491.729.4.camel@mercury.atomicode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)Wheeler(dot)net ICQ: 15726394
Yahoo!: dew7e
Jabber: Theory(at)jabber(dot)org

Attachment Content-Type Size
DBD-Pg.diff text/plain 2.8 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Wheeler 2001-11-18 21:33:55 Re: DBD::Pg BYTEA Character Escaping
Previous Message Sharon Cowling 2001-11-18 21:17:00 Problem with type in rule