Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 129744A6685 for ; Thu, 10 May 2012 22:50:27 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SSezu-0003BC-76 for pgsql-bugs@postgresql.org; Fri, 11 May 2012 01:50:26 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q4B1o7Li018431; Thu, 10 May 2012 21:50:07 -0400 (EDT) To: Robert Haas cc: Josh Kupershmidt , Bruce Momjian , stuart@stuartbishop.net, pgsql-bugs@postgresql.org Subject: Re: BUG #6624: Tab completion of identifier containing single backslash triggers warnings In-reply-to: References: <20120502182110.GE21098@momjian.us> <3034.1335997750@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 07 May 2012 20:40:23 -0400" Date: Thu, 10 May 2012 21:50:06 -0400 Message-ID: <18430.1336701006@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/56 X-Sequence-Number: 33027 Robert Haas writes: > On Wed, May 2, 2012 at 6:29 PM, Tom Lane wrote: >> 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. > PQescapeLiteral will do the job, no? At least in 9.0+. Hmm ... it would, but then psql would fail entirely when talking to pre-8.1 servers, so we'd need to check the server version to decide which quoting method to use. Do you think this is important enough to add yet more version-specific tests to that code? regards, tom lane