Re: Sequence usage patch

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rod Taylor <rbt(at)rbt(dot)ca>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Sequence usage patch
Date: 2003-05-27 06:07:21
Message-ID: Pine.LNX.4.21.0305271604500.24855-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Tue, 27 May 2003, Tom Lane wrote:

> Rod Taylor <rbt(at)rbt(dot)ca> writes:
> > I don't see PREVIOUS as a reserved word, but CURRENT
> > certainly is -- WHERE CURRENT OF for cursors, and several other places.
>
> > The attached patch makes CURRENT a reserved word.
>
> I do not think it will be necessary to treat CURRENT as a fully-reserved
> word in order to support WHERE CURRENT OF, and accordingly I'm not very
> happy with reserving it in order to support this ungainly,
> not-yet-and-possibly-never-standard syntax. I still think that Oracle's
> syntax is nicer, and by any sane estimate it is more of a real-world
> standard than an unapproved 2000-something draft.

I have an in development patch to add where current of. CURRENT needs only
be added to the unreserved_keyword list. gram.y compiles fine and usage of
current doesn't cause parse errors:

template1=# create table abc (current text);
CREATE TABLE
template1=# insert into abc values('that');
INSERT 17079 1
template1=# insert into abc values('this');
INSERT 17080 1
template1=# begin;
BEGIN
template1=# declare blah cursor for select * from abc;
DECLARE CURSOR
template1=# fetch blah;
current
---------
that
(1 row)

template1=# update abc set current='that2' where current of blah;
UPDATE 1
template1=# commit;

Gavin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Darko Prenosil 2003-05-27 09:53:38 Execute function on login ???
Previous Message Bruce Momjian 2003-05-27 04:39:56 Re: [BUGS] Bug #928: server_min_messages (log_min_messages

Browse pgsql-patches by date

  From Date Subject
Next Message Rod Taylor 2003-05-27 13:41:44 Re: Sequence usage patch
Previous Message Bruce Momjian 2003-05-27 04:39:56 Re: [BUGS] Bug #928: server_min_messages (log_min_messages