Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.
Date
Msg-id 20131006042506.GB6135@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Michael Paquier escribió:

> =# discard sequences ;
> DISCARD SEQUENCES
> =# select currval('foo');
> ERROR:  55000: currval of sequence "foo" is not yet defined in this session
> LOCATION:  currval_oid, sequence.c:780
> =# select lastval();
> The connection to the server was lost. Attempting reset: Failed.

I wonder if it would be better to have this "seqtab" thing be a dlist,
and move the most recently used item to head position on nextval().
That way we don't have to maintain last_used_seq separately.

I also just noticed that the DISCARD SEQUENCE patch made a "NOTE:"
comment in init_sequence be outdated.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: 9.4 HEAD: select() failed in postmaster
Next
From: Fabien COELHO
Date:
Subject: Re: pgbench progress report improvements - split 3 v2 - A