From ff481ca0d463d33246a331c92bdf3dfc018c24eb Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 10 Jul 2007 00:21:31 +0000 Subject: Adjust processSQLNamePattern() so that $ within the pattern is always matched literally, whether quoted or not. Since we allow $ as a character within identifiers, this behavior is useful, whereas the previous behavior of treating it as the regexp ending anchor was nearly useless given that the pattern is automatically anchored anyway. This affects the arguments of psql's \d commands as well as pg_dump's -n and -t switches. Per discussion. --- doc/src/sgml/ref/psql-ref.sgml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 7da2f4f4561..1bec1059e82 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1,5 +1,5 @@ @@ -1916,8 +1916,8 @@ lo_import 152801 A pattern that contains a dot (.) is interpreted as a schema name pattern followed by an object name pattern. For example, - \dt foo*.bar* displays all tables whose table name - starts with bar that are in schemas whose schema name + \dt foo*.*bar* displays all tables whose table name + includes bar that are in schemas whose schema name starts with foo. When no dot appears, then the pattern matches only objects that are visible in the current schema search path. Again, a dot within double quotes loses its special meaning and is matched @@ -1930,17 +1930,20 @@ lo_import 152801 expression special characters work as specified in , except for . which is taken as a separator as mentioned above, * which is - translated to the regular-expression notation .*, and - ? which is translated to .. You can emulate + translated to the regular-expression notation .*, + ? which is translated to ., and + $ which is matched literally. You can emulate these pattern characters at need by writing ? for ., (R+|) for R*, or (R|) for R?. - Remember that the pattern must match the whole name, unlike the usual - interpretation of regular expressions; write * at the beginning - and/or end if you don't wish the pattern to be anchored. + $ is not needed as a regular-expression character since + the pattern must match the whole name, unlike the usual + interpretation of regular expressions (in other words, $ + is automatically appended to your pattern). Write * at the + beginning and/or end if you don't wish the pattern to be anchored. Note that within double quotes, all regular expression special characters lose their special meanings and are matched literally. Also, the regular expression special characters are matched literally in operator name -- cgit v1.2.3