Re: pg_dump vs PQescapeBytea - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: pg_dump vs PQescapeBytea
Date
Msg-id 1249417215.3653.108.camel@monkey-cat.sm.truviso.com
Whole thread Raw
In response to pg_dump vs PQescapeBytea  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_dump vs PQescapeBytea  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, 2009-08-04 at 13:35 -0400, Tom Lane wrote:
> I speculated about fixing that by inventing a "PQescapeByteaHex"
> function, but that was pure brain fade :-(.  The hex format for
> bytea still requires one backslash in the value, so you still have
> to know standard_conforming_strings to get it right.

On a related topic: right now it's impossible to safely escape (using
libpq alone) bytea data for use as a text-format argument to a
parameterized query. This is because PQescapeBytea returns a string that
is both escaped for bytea and escaped for inclusion in a SQL string (am
I wrong here?).

It's a pretty minor issue, but a little inconsistent. Is it worth
addressing?

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: the case for machine-readable error fields
Next
From: Robert Haas
Date:
Subject: Re: the case for machine-readable error fields