Re: [HACKERS] Inconsistent syntax in GRANT - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [HACKERS] Inconsistent syntax in GRANT
Date
Msg-id 200601070438.k074c0k02872@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Inconsistent syntax in GRANT  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Inconsistent syntax in GRANT
List pgsql-patches
Tom Lane wrote:
> Marko Kreen <markokr@gmail.com> writes:
> > Good point about compatibility.  But makes the common case ugly.
> > "For regular usage you need to grant SELECT, USAGE ..."  Huh? :)
>
> > How about this:
>
> > SELECT: currval
> > INSERT: nextval
> > UPDATE: nextval, setval
> > USAGE: nextval, currval
>
> Seems a little weird.  Hmm ... what is the use-case for allowing someone
> to do nextval but not currval?  I can't see one.  How about we simplify
> this to
>
> SELECT: currval
> UPDATE: nextval, setval
> USAGE: nextval, currval
>
> This is still upward compatible with our old behavior, which is
>
> SELECT: currval
> UPDATE: nextval, setval
>
> and it still meets the SQL spec's requirement that USAGE allow nextval,
> and USAGE is the only one you need for "normal" usage.

I think your original proposal was better.  Why is it important that we
have a single-keyword usage for the common case?  No one has complained
about what we have now and that requires two keywords just like your
proposal.  We don't have a shorthand for GRANT INSERT/UPDATE/DELETE.  In
fact, if it was backward-compatible I would suggest we make UPDATE just
setval.  Does the standard require USAGE to support currval?

--
  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

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Inconsistent syntax in GRANT
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Inconsistent syntax in GRANT