Re: [HACKERS] Inconsistent syntax in GRANT
Re: [HACKERS] Inconsistent syntax in GRANT
От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Jaime Casanova wrote: > On 1/6/06, Tom Lane wrote: > > Marko Kreen 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . > . . . . . . . . . . . . 739 > > this is taken from the 12.3 > > 3) If specifies a , , > , , user-defined type name>, or , then > 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 is contained in a , then the applicable privileges for the that owns the containing schema shall include USAGE privilege on the sequence generator identified by . 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
Re: [HACKERS] Inconsistent syntax in GRANT
От:
Jaime Casanova <systemguards@gmail.com>
Дата:
On 1/6/06, Bruce Momjian wrote: > Jaime Casanova wrote: > > On 1/6/06, Tom Lane wrote: > > > Marko Kreen 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . > > . . . . . . . . . . . . 739 > > > > this is taken from the 12.3 > > > > 3) If specifies a , , > > , , > user-defined type name>, or , then > > 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 is contained in a , > then the applicable privileges for the that > owns the containing schema shall include USAGE privilege on the sequence > generator identified by . > > 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 ;)