Re: What's the CURRENT schema ? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: What's the CURRENT schema ?
Date
Msg-id Pine.LNX.4.30.0204040003120.684-100000@peter.localdomain
Whole thread Raw
In response to Re: What's the CURRENT schema ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: What's the CURRENT schema ?
List pgsql-hackers
Tom Lane writes:

> PUBLIC is a reserved keyword, so you have to do something like
>     select * from "public".vs1;
> if there is a vs1 hiding it in an earlier namespace in the search
> path.

PUBLIC can be made less reserved easily.  See patch below.

> I've been vacillating about whether to choose another name for the
> public namespace to avoid the need for quotes here.  I can't think
> of another good name :-(

PUBLIC is a good name.  Oracle uses it, I think.


diff -u -r2.299 gram.y
--- gram.y  1 Apr 2002 04:35:38 -0000   2.299
+++ gram.y  4 Apr 2002 05:10:23 -0000
@@ -2558,14 +2558,14 @@                   n->groupname = NULL;                   $$ = (Node *)n;               }
-       | GROUP ColId
+       | GROUP UserId               {                   PrivGrantee *n = makeNode(PrivGrantee);
n->username= NULL;                   n->groupname = $2;                   $$ = (Node *)n;               }
 
-       | ColId
+       | UserId               {                   PrivGrantee *n = makeNode(PrivGrantee);
n->username= $1;
 
@@ -5897,7 +5897,6 @@
Iconst:  ICONST                            { $$ = $1; };Sconst:  SCONST                            { $$ = $1; };
-UserId:  ColId                         { $$ = $1; };
/* * Name classification hierarchy.
@@ -5913,6 +5912,13 @@/* Column identifier --- names that can be column, table, etc names. */ColId:  IDENT
           { $$ = $1; }
 
+       | unreserved_keyword            { $$ = $1; }
+       | col_name_keyword              { $$ = $1; }
+       | PUBLIC                        { $$ = "public"; }
+       ;
+
+/* User identifier */
+UserId:  IDENT                         { $$ = $1; }       | unreserved_keyword            { $$ = $1; }       |
col_name_keyword             { $$ = $1; }       ;
 

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: What's the CURRENT schema ?
Next
From: Bruce Momjian
Date:
Subject: Re: Contrib update