Re: pg_dump vs PQescapeBytea - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_dump vs PQescapeBytea
Date
Msg-id 20903.1249417671@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump vs PQescapeBytea  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> 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?).

True, but I would think that most people would prefer to use binary
format and not do any conversion/escaping at all in that situation.
I doubt it's worth producing still another variant of PQescapeBytea
for the people who insist on a text conversion for that case.  (The
hex mode already made their lives a lot easier, anyway.)
        regards, tom lane


pgsql-hackers by date:

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