On 1/6/06, Bruce Momjian <pgman@candle.pha.pa.us> wrote:
> 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?
>
USAGE is the only privilege that the standard consider applicable for the owner?
it covers all operations in sequences...
--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)