[ catching up on email... ]
Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> If you hit tab on a table name containing a \ you get spammed with a
> series of WARNINGS and HINTS about nonstandard use of \\ in a string
Yeah. This is actually a generic problem for *all* applications using
PQescapeString or PQescapeStringConn: it's impossible for those routines
to suppress the warning, since they don't get to put E'' around their
This class of problem isn't really going to go away until
standard_conforming_strings is usually ON. I'm not sure I want to see
it ON by default in 8.4, but it'll happen eventually. Given that that's
where things are going, maybe extreme effort to fix the problem now
> There are a few options here:
> 1) Use E'' in all the psql completion queries. This means they won't work on
> older versions of postgres (but they don't in general do so anyways). It would
> also break anybody who set standard_conforming_string = 'on'.
Huh? It'll work fine with standard_conforming_strings ON. The
backward-compatibility problem is a bigger one. Right now, tab
completion (at least for table names) works fine with servers back to
7.3. If we depend on E'' then it would only work back to 8.1.
> 2) Use $$%s$$ style quoting.
This would work back to 8.0, which is better but not by much. And as
you note it'd be a PITA from a programming point of view.
> 3) set standards_conforming_strings=on for psql tab-completion queries and
> then reset it afterwards.
> 4) Replace PQExec with PQExecParam in tab-complete.c
Doable but notationally tedious.
Another idea that comes to mind is to suppress warning messages during
tab completion, by temporarily altering the libpq notice-processor hook.
This is pretty ugly too but would at least be a localized change.
regards, tom lane
In response to
pgsql-hackers by date
|Next:||From: Simon Riggs||Date: 2008-01-12 09:32:26|
|Subject: Re: Transaction Snapshot Cloning|
|Previous:||From: Tom Lane||Date: 2008-01-12 02:59:46|
|Subject: A note about SIGTERM illusion and reality|