Is everyone okay with the following syntax:

CREATE USER username
[ WITH ID digits ]
^^^^^^^^^^^^^^^^^^
[ WITH PASSWORD password ]
[ CREATEDB | NOCREATEDB ]
[ CREATEUSER | NOCREATEUSER ]
[ IN GROUP groupname [, ...] ]
[ VALID UNTIL 'abstime' ]

ALTER USER username
[ WITH ID digits ]
^^^^^^^^^^^^^^^^^^
[ WITH PASSWORD password ]
[ CREATEDB | NOCREATEDB ]
[ CREATEUSER | NOCREATEUSER ]
[ IN GROUP groupname [, ...] ]
[ VALID UNTIL 'abstime' ]

The catch is that ID would have to be a new keyword and we'd have to live
with that for a long time. Other choices include:
* UID
* SYSID
* USESYSID
etc.

What do the standards and pseudo-standards say?

I think I'll take a stab at this and settle the createuser script issue
the proper way.

-Peter

--
Peter Eisentraut Sernanders vaeg 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden

Search Discussions

  • Tom Lane at Nov 13, 1999 at 4:10 am

    Peter Eisentraut writes:
    Is everyone okay with the following syntax:
    CREATE USER username
    [ WITH ID digits ]
    ^^^^^^^^^^^^^^^^^^
    The catch is that ID would have to be a new keyword and we'd have to live
    with that for a long time. Other choices include:
    * UID
    * SYSID
    * USESYSID
    etc.
    I'd be inclined to go with UID or SYSID. In any case, since the new
    keyword is used in such a limited context, we could almost certainly
    still allow it as a ColId and thus not create any real compatibility
    problem.

    regards, tom lane
  • Peter Eisentraut at Nov 13, 1999 at 1:38 pm

    On Fri, 12 Nov 1999, Tom Lane wrote:

    Peter Eisentraut <peter_e@gmx.net> writes:
    Is everyone okay with the following syntax:
    CREATE USER username
    [ WITH ID digits ]
    ^^^^^^^^^^^^^^^^^^
    The catch is that ID would have to be a new keyword and we'd have to live
    with that for a long time. Other choices include:
    * UID
    * SYSID
    * USESYSID
    etc.
    I'd be inclined to go with UID or SYSID. In any case, since the new
    keyword is used in such a limited context, we could almost certainly
    still allow it as a ColId and thus not create any real compatibility
    problem.
    I'm not sure about this distinction. Where would that be reflected in the
    (parser) code?

    -Peter

    --
    Peter Eisentraut Sernanders vaeg 10:115
    peter_e@gmx.net 75262 Uppsala
    http://yi.org/peter-e/ Sweden
  • Tom Lane at Nov 13, 1999 at 2:57 pm

    Peter Eisentraut writes:
    I'd be inclined to go with UID or SYSID. In any case, since the new
    keyword is used in such a limited context, we could almost certainly
    still allow it as a ColId and thus not create any real compatibility
    problem.
    I'm not sure about this distinction. Where would that be reflected in the
    (parser) code?
    You should try to add this (or any other) new keyword to the list in the
    ColId: production in gram.y. If that doesn't provoke any complaints
    from yacc (shift/reduce conflicts etc), then you're home free: the
    parser won't get confused if the keyword is used as a column name.

    If it does cause a shift/reduce conflict, which is fairly likely for
    anything that can appear inside an expression, you might still be
    able to add the new keyword to the ColLabel: list. That allows it
    to be used as an identifier in a more restricted set of contexts.

    Only if neither of these will work does the keyword need to be a
    truly "reserved" word.

    regards, tom lane

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedNov 13, '99 at 12:47a
activeNov 13, '99 at 2:57p
posts4
users3
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase