Re: [HACKERS] Inconsistent syntax in GRANT

From: Marko Kreen <markokr(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Inconsistent syntax in GRANT
Date: 2006-01-06 21:29:10
Message-ID: e51f66da0601061329r6ecabccq3262066ba601fd19@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On 1/6/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Marko Kreen <markokr(at)gmail(dot)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.

With bigserial this is more like CPU DoS, while other users can work
normally.

> 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.
> Bruce couldn't find anything in it about this but I can't believe the
> info isn't there somewhere.

Google tells that Oracle has ALTER and SELECT; DB2 has ALTER and USAGE.

I found SQL2003 pdf's too ... from my reading it has only USAGE.

5WD-02-Foundation-2003-09.pdf:
page 724 -> General Rules -> #2
page 740 -> Syntax rules -> #3

Everything combined:
SELECT: currval
UPDATE: nextval
USAGE: currval, nextval
ALTER: setval

Confusing?

--
marko

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-01-06 21:49:05 Re: [HACKERS] Inconsistent syntax in GRANT
Previous Message Greg Stark 2006-01-06 21:13:04 Re: Improving N-Distinct estimation by ANALYZE

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-01-06 21:49:05 Re: [HACKERS] Inconsistent syntax in GRANT
Previous Message Bruce Momjian 2006-01-06 20:38:00 Re: [HACKERS] Inconsistent syntax in GRANT