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

From Tom Lane
Subject pgsql: Clean up weird corner cases in lexing of psql meta-command argum
Date
Msg-id E1Qx0b0-0003fm-GB@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: pgsql: Fix pgrminclude regex pattern.
Next
From: Tom Lane
Date:
Subject: pgsql: Support non-ASCII letters in psql variable names.