Re: [PATCHES] Grammer Cleanup

2005-06-10 Thread Stephen Frost
* Bruce Momjian (pgman@candle.pha.pa.us) wrote:
> I am removing this patch from the queue because without the "role"
> feature I don't think it makes sense to rename the grammer tokens.

Sure.  I've rolled this patch into my role tree so these changes will be
included when the CREATE ROLE, etc is introduced.

Thanks,

Stephen

> Stephen Frost wrote:
> > * Tom Lane ([EMAIL PROTECTED]) wrote:
> > > Stephen Frost <[EMAIL PROTECTED]> writes:
> > > > Ok, should I change SchemaName & SavePointId back to ColId,
> > > 
> > > I'd just leave them as ColId.  I don't think much would be gained by
> > > introducing those productions.
> > 
> > Done, here's the patch.
> > 
> > Thanks,
> > 
> > Stephen
> 
> [ Attachment, skipping... ]
> 
> > 
> > ---(end of broadcast)---
> > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
> 
> -- 
>   Bruce Momjian|  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us   |  (610) 359-1001
>   +  If your life is a hard drive, |  13 Roberts Road
>   +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073


signature.asc
Description: Digital signature


Re: [PATCHES] Grammer Cleanup

2005-06-10 Thread Bruce Momjian

I am removing this patch from the queue because without the "role"
feature I don't think it makes sense to rename the grammer tokens.

---

Stephen Frost wrote:
> * Tom Lane ([EMAIL PROTECTED]) wrote:
> > Stephen Frost <[EMAIL PROTECTED]> writes:
> > > Ok, should I change SchemaName & SavePointId back to ColId,
> > 
> > I'd just leave them as ColId.  I don't think much would be gained by
> > introducing those productions.
> 
> Done, here's the patch.
> 
>   Thanks,
> 
>   Stephen

[ Attachment, skipping... ]

> 
> ---(end of broadcast)---
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] Grammer Cleanup

2005-01-03 Thread Bruce Momjian

This has been saved for the 8.1 release:

http:/momjian.postgresql.org/cgi-bin/pgpatches2

---

Stephen Frost wrote:
> * Tom Lane ([EMAIL PROTECTED]) wrote:
> > Stephen Frost <[EMAIL PROTECTED]> writes:
> > > Ok, should I change SchemaName & SavePointId back to ColId,
> > 
> > I'd just leave them as ColId.  I don't think much would be gained by
> > introducing those productions.
> 
> Done, here's the patch.
> 
>   Thanks,
> 
>   Stephen

[ Attachment, skipping... ]

> 
> ---(end of broadcast)---
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [PATCHES] Grammer Cleanup

2004-12-29 Thread Stephen Frost
* Tom Lane ([EMAIL PROTECTED]) wrote:
> Stephen Frost <[EMAIL PROTECTED]> writes:
> > Ok, should I change SchemaName & SavePointId back to ColId,
> 
> I'd just leave them as ColId.  I don't think much would be gained by
> introducing those productions.

Done, here's the patch.

Thanks,

Stephen
diff -u -u -r2.480 gram.y
--- src/backend/parser/gram.y   8 Nov 2004 04:02:20 -   2.480
+++ src/backend/parser/gram.y   29 Dec 2004 19:04:29 -
@@ -304,7 +304,7 @@
 
 %typeIconst
 %type Sconst comment_text
-%type UserId opt_boolean ColId_or_Sconst
+%type RoleId opt_boolean ColId_or_Sconst
 %typevar_list var_list_or_default
 %type ColId ColLabel var_name type_name param_name
 %typevar_value zone_value
@@ -570,7 +570,7 @@
  */
 
 CreateUserStmt:
-   CREATE USER UserId opt_with OptUserList
+   CREATE USER RoleId opt_with OptUserList
{
CreateUserStmt *n = 
makeNode(CreateUserStmt);
n->user = $3;
@@ -592,7 +592,7 @@
  */
 
 AlterUserStmt:
-   ALTER USER UserId opt_with OptUserList
+   ALTER USER RoleId opt_with OptUserList
 {
AlterUserStmt *n = 
makeNode(AlterUserStmt);
n->user = $3;
@@ -603,7 +603,7 @@
 
 
 AlterUserSetStmt:
-   ALTER USER UserId SET set_rest
+   ALTER USER RoleId SET set_rest
{
AlterUserSetStmt *n = 
makeNode(AlterUserSetStmt);
n->user = $3;
@@ -611,7 +611,7 @@
n->value = $5->args;
$$ = (Node *)n;
}
-   | ALTER USER UserId VariableResetStmt
+   | ALTER USER RoleId VariableResetStmt
{
AlterUserSetStmt *n = 
makeNode(AlterUserSetStmt);
n->user = $3;
@@ -691,8 +691,8 @@
}
;
 
-user_list: user_list ',' UserId{ $$ = lappend($1, 
makeString($3)); }
-   | UserId{ $$ = 
list_make1(makeString($1)); }
+user_list: user_list ',' RoleId{ $$ = lappend($1, 
makeString($3)); }
+   | RoleId{ $$ = 
list_make1(makeString($1)); }
;
 
 
@@ -705,7 +705,7 @@
  */
 
 CreateGroupStmt:
-   CREATE GROUP_P UserId opt_with OptGroupList
+   CREATE GROUP_P RoleId opt_with OptGroupList
{
CreateGroupStmt *n = 
makeNode(CreateGroupStmt);
n->name = $3;
@@ -742,7 +742,7 @@
  */
 
 AlterGroupStmt:
-   ALTER GROUP_P UserId add_drop USER user_list
+   ALTER GROUP_P RoleId add_drop USER user_list
{
AlterGroupStmt *n = 
makeNode(AlterGroupStmt);
n->name = $3;
@@ -765,7 +765,7 @@
  */
 
 DropGroupStmt:
-   DROP GROUP_P UserId
+   DROP GROUP_P RoleId
{
DropGroupStmt *n = 
makeNode(DropGroupStmt);
n->name = $3;
@@ -781,7 +781,7 @@
  */
 
 CreateSchemaStmt:
-   CREATE SCHEMA OptSchemaName AUTHORIZATION UserId 
OptSchemaEltList
+   CREATE SCHEMA OptSchemaName AUTHORIZATION RoleId 
OptSchemaEltList
{
CreateSchemaStmt *n = 
makeNode(CreateSchemaStmt);
/* One can omit the schema name or the 
authorization id. */
@@ -1300,8 +1300,8 @@
 
 /* Subcommands that are for ALTER TABLE or ALTER INDEX */
 alter_rel_cmd:
-   /* ALTER [TABLE|INDEX]  OWNER TO UserId */
-   OWNER TO UserId
+   /* ALTER [TABLE|INDEX]  OWNER TO RoleId */
+   

Re: [PATCHES] Grammer Cleanup

2004-12-29 Thread Tom Lane
Stephen Frost <[EMAIL PROTECTED]> writes:
> Ok, should I change SchemaName & SavePointId back to ColId,

I'd just leave them as ColId.  I don't think much would be gained by
introducing those productions.

regards, tom lane

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] Grammer Cleanup

2004-12-29 Thread Stephen Frost
* Tom Lane ([EMAIL PROTECTED]) wrote:
> Given other discussion, it might be best to rename it to RoleId and use
> that for both users and groups.

Ok, should I change SchemaName & SavePointId back to ColId, leave them
as in the patch, change them to RoleId, or something else?  Neither
ColId nor RoleId seems appropriate for those..

Thanks,

Stephen


signature.asc
Description: Digital signature


Re: [PATCHES] Grammer Cleanup

2004-12-29 Thread Tom Lane
Stephen Frost <[EMAIL PROTECTED]> writes:
> Personally, I'd just like it to be
> consistent, when I was looking at how to add the grammar for group
> ownership group names were identified in one place as 'ColId' and another
> as 'UserId', iirc.

Oh, I had forgotten we already had a UserId production.  Yes, I agree
that if we're going to have that at all, it should be used consistently
in the places it applies to.

Given other discussion, it might be best to rename it to RoleId and use
that for both users and groups.

regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PATCHES] Grammer Cleanup

2004-12-29 Thread Stephen Frost
* Tom Lane ([EMAIL PROTECTED]) wrote:
> Stephen Frost <[EMAIL PROTECTED]> writes:
> > Do you agree with the other changes (ColId -> SchemaName, ColId ->=20
> > SavePointId) ?
> 
> I don't really see the value of them.  They add some marginal
> documentation I suppose, but they also make the grammar bigger and
> slower.  A more substantial objection to the practice is that it can
> introduce needless shift/reduce conflicts, by forcing the parser into
> making unnecessary decisions before it has enough context to
> determine what kind of name a particular token really is.

Perhaps the name of 'ColId' should be changed then.  At least to me that
comes across as 'Column Identifier', and apparently some others thought
it wasn't appropriate for user names (UserId existed and was mapped to 
ColId prior to my patch).  Personally, I'd just like it to be
consistent, when I was looking at how to add the grammar for group
ownership group names were identified in one place as 'ColId' and another
as 'UserId', iirc.

Stephen


signature.asc
Description: Digital signature


Re: [PATCHES] Grammer Cleanup

2004-12-29 Thread Tom Lane
Stephen Frost <[EMAIL PROTECTED]> writes:
> Do you agree with the other changes (ColId -> SchemaName, ColId ->=20
> SavePointId) ?

I don't really see the value of them.  They add some marginal
documentation I suppose, but they also make the grammar bigger and
slower.  A more substantial objection to the practice is that it can
introduce needless shift/reduce conflicts, by forcing the parser into
making unnecessary decisions before it has enough context to
determine what kind of name a particular token really is.

(I don't claim that your patch as it stands has any such problem,
because it doesn't touch any particularly hairy parts of the grammar.
I'm just saying why I don't necessarily believe in a separate production
for every kind of name.)

regards, tom lane

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] Grammer Cleanup

2004-12-29 Thread Stephen Frost
* Tom Lane ([EMAIL PROTECTED]) wrote:
> Stephen Frost <[EMAIL PROTECTED]> writes:
> >   Small patch to clean up the grammer a bit by adding 'GroupId',
> >   'SchemaName' and 'SavePointId'.
> 
> I don't particularly see the value of this --- especially since the
> direction of future development is likely to be to remove the
> distinction between user and group names, rather than make it stronger.

Alright, I can redo it w/ UserId in place of GroupId everywhere.  I'd
like your comment on the 'pg_class changes for group ownership' on
-hackers, which might play into these changes too.  Previously 'GRANT' 
had 'ColId' instead of either, which isn't really appropriate there...
Do you agree with the other changes (ColId -> SchemaName, ColId -> 
SavePointId) ?

Thanks,

Stephen


signature.asc
Description: Digital signature


Re: [PATCHES] Grammer Cleanup

2004-12-29 Thread Tom Lane
Stephen Frost <[EMAIL PROTECTED]> writes:
>   Small patch to clean up the grammer a bit by adding 'GroupId',
>   'SchemaName' and 'SavePointId'.

I don't particularly see the value of this --- especially since the
direction of future development is likely to be to remove the
distinction between user and group names, rather than make it stronger.

regards, tom lane

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings