pgsql: Clean up weird corner cases in lexing of psql meta-command argum

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Clean up weird corner cases in lexing of psql meta-command argum
Date: 2011-08-26 17:53:34
Message-ID: E1Qx0b0-0003fm-GB@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Clean up weird corner cases in lexing of psql meta-command arguments.

These changes allow backtick command evaluation and psql variable
interpolation to happen on substrings of a single meta-command argument.
Formerly, no such evaluations happened at all if the backtick or colon
wasn't the first character of the argument, and we considered an argument
completed as soon as we'd processed one backtick, variable reference, or
quoted substring. A string like 'FOO'BAR was thus taken as two arguments
not one, not exactly what one would expect. In the new coding, an argument
is considered terminated only by unquoted whitespace or backslash.

Also, clean up a bunch of omissions, infelicities and outright errors in
the psql documentation of variables and metacommand argument syntax.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/928311a463d480ca566e2905a369ac6aa0c3e210

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 171 ++++++++++++--------
src/bin/psql/command.c | 2 +-
src/bin/psql/psqlscan.h | 2 +-
src/bin/psql/psqlscan.l | 347 ++++++++++++++++++++--------------------
4 files changed, 275 insertions(+), 247 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-08-26 20:52:43 pgsql: Fix potential memory clobber in tsvector_concat().
Previous Message Bruce Momjian 2011-08-26 14:33:21 pgsql: Fix pgrminclude regex pattern.