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.
regards, tom lane