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

From Bruce Momjian
Subject Re: [HACKERS] Inconsistent syntax in GRANT
Date
Msg-id 200601062201.k06M1Ji21556@candle.pha.pa.us
Whole thread Raw
Responses Re: [HACKERS] Inconsistent syntax in GRANT
List pgsql-patches
Jaime Casanova wrote:
> On 1/6/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Marko Kreen <markokr@gmail.com> writes:
> > > But my question is rather - is there any scenario where setval() should
> > > go with nextval()?
> >
> > > It seems that their pairing is an accident and should be fixed.
> >
> > I think the original argument for the current design was that with
> > enough nextval's you can duplicate the effect of a setval.  This is only
> > strictly true if the sequence is CYCLE mode, and even then it'd take a
> > whole lot of patience to wrap an int8 sequence around ... but the
> > distinction between them is not so large as you make it out to be.
> >
> > In any case I think we are wasting our time discussing it, and instead
> > should be looking through the SQL2003 spec to see what it requires.
>
> 5WD-02-Foundation-2003-09.pdf
>
> look at:
> 4.34.2 Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . .
> . . . . . . . . . . . . 112
> and
> 12.3 <privileges>. . . . . . . . . . . . . . . . . . . . . . . . . . .
> . . . . . . . . . . . . 739
>
> this is taken from the 12.3
>
> 3) If <object name> specifies a <domain name>, <collation name>,
> <character set name>, <transliteration name>, <schema-resolved
> user-defined type name>, or <sequence generator name>, then
> <privileges> may specify USAGE. Otherwise, USAGE shall not be
> specified.

Yes, I saw that, but how does that hook into nextval/setval/currval()?
I think I see it in 6.13:

    a) If <next value expression> is contained in a <schema definition>,
    then the applicable privileges for the <authorization identifier> that
    owns the containing schema shall include USAGE privilege on the sequence
    generator identified by <sequence generator name>.

Is that it?

--
  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: Bruce Momjian
Date:
Subject: Re: [HACKERS] Inconsistent syntax in GRANT
Next
From: Marko Kreen
Date:
Subject: Re: [HACKERS] Inconsistent syntax in GRANT