From: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Kupershmidt <schmiddy@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: stuart@stuartbishop.net
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6624: Tab completion of identifier containing single backslash triggers warnings
Date: Wed, 02 May 2012 18:29:10 -0400
Message-ID: <3034.1335997750@sss.pgh.pa.us> (raw)
In-Reply-To: <CAK3UJRGkNX+7qqR0VLFg+yo9nbBxsP4PaTXOGB4-k6kx5mHt2A@mail.gmail.com>
References: <E1SPZ9y-0003PX-Qz@wrigleys.postgresql.org>
<20120502182110.GE21098@momjian.us>
<CAK3UJRGkNX+7qqR0VLFg+yo9nbBxsP4PaTXOGB4-k6kx5mHt2A@mail.gmail.com>
Josh Kupershmidt <schmiddy@gmail.com> writes:
> On Wed, May 2, 2012 at 11:21 AM, Bruce Momjian <bruce@momjian.us> wrote:
>> On Wed, May 02, 2012 at 12:59:58PM +0000, stuart@stuartbishop.net wrote:
>>> # CREATE SEQUENCE "\foo";
>>> CREATE SEQUENCE
>>> # \ds "\
>> I am unable to reproduce this failure on my copy of 9.1.3. Have you
>> perhaps changed any server settings?
> I only get the error if I:
> SET standard_conforming_strings TO off;
> otherwise, it works fine. Perhaps it's still worth fixing though.
AFAICT, you get this behavior in every release back to 8.1, if you have
both escape_string_warning ON and standard_conforming_strings OFF;
which was the default configuration from 8.2 through 9.0. The lack of
prior complaints suggests pretty strongly that backslashes in names are
not common in the field.
The only way we could suppress such warnings would be if we made
tab-complete.c use E'' strings for literals containing name prefixes;
which is perhaps doable but it would mean having tab-complete.c roll
its own string escaping rather than use any facility now available
from libpq. (PQescapeString and friends presume that the result will
be emitted as a plain string.)
This issue isn't peculiar to tab-complete.c, either; in general, *any*
client that uses PQescapeString and friends is going to get bombarded
with this type of warning when the server is configured that way, even
though what it's doing is perfectly safe. I don't remember at the
moment why we designed those functions that way, but presumably the
alternatives were worse.
I'm inclined to think that if we got this far without complaint, there's
not a lot of point in writing new string-escaping support to solve what
is now a legacy problem.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, schmiddy@gmail.com, bruce@momjian.us, stuart@stuartbishop.net
Subject: Re: BUG #6624: Tab completion of identifier containing single backslash triggers warnings
In-Reply-To: <3034.1335997750@sss.pgh.pa.us>
References: <E1SPZ9y-0003PX-Qz@wrigleys.postgresql.org> <20120502182110.GE21098@momjian.us> <CAK3UJRGkNX+7qqR0VLFg+yo9nbBxsP4PaTXOGB4-k6kx5mHt2A@mail.gmail.com> <3034.1335997750@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox