From 928311a463d480ca566e2905a369ac6aa0c3e210 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 26 Aug 2011 13:52:23 -0400 Subject: 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. --- src/bin/psql/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bin/psql/command.c') diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 6d9cd6492f6..2c389021be7 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -121,7 +121,7 @@ HandleSlashCmds(PsqlScanState scan_state, /* eat any remaining arguments after a valid command */ /* note we suppress evaluation of backticks here */ while ((arg = psql_scan_slash_option(scan_state, - OT_VERBATIM, NULL, false))) + OT_NO_EVAL, NULL, false))) { psql_error("\\%s: extra argument \"%s\" ignored\n", cmd, arg); free(arg); -- cgit v1.2.3