Re: PQescapeLiteral in Libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "lmanorders" <lmanorders(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: PQescapeLiteral in Libpq
Date: 2014-01-09 19:32:37
Message-ID: 16244.1389295957@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"lmanorders" <lmanorders(at)gmail(dot)com> writes:
> I'm using the libpq.dll libraries to connect to postgress. When I issue a call to PQescapeLiteral with a file path as the argument, the result string seems to always start with a bogus " E".

That's not bogus, it's the intended behavior. Per the source code:

* If we are escaping a literal that contains backslashes, we use the
* escape string syntax so that the result is correct under either value
* of standard_conforming_strings. We also emit a leading space in this
* case, to guard against the possibility that the result might be
* interpolated immediately following an identifier.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message David Johnston 2014-01-09 19:35:38 Re: PQescapeLiteral in Libpq
Previous Message lmanorders 2014-01-09 19:24:10 PQescapeLiteral in Libpq