Skip site navigation (1) Skip section navigation (2)

Re: BUG #3619: Renaming sequence does not update its'sequence_name' field

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: ioguix <ioguix(at)free(dot)fr>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3619: Renaming sequence does not update its'sequence_name' field
Date: 2007-09-26 14:23:56
Message-ID: 20070926142356.GC8572@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Tom Lane wrote:
> ioguix <ioguix(at)free(dot)fr> writes:
> > br3619=# CREATE SEQUENCE sample_seq_to_rename;
> > CREATE SEQUENCE
> > br3619=# select sequence_name from sample_seq_to_rename;
> >     sequence_name
> > ----------------------
> >  sample_seq_to_rename
> > (1 ligne)
> 
> > br3619=# ALTER TABLE sample_seq_to_rename RENAME TO sample_seq;
> > ALTER TABLE
> > br3619=# select sequence_name from sample_seq;
> >     sequence_name
> > ----------------------
> >  sample_seq_to_rename
> > (1 ligne)
> 
> This is something we are unlikely to change, because it would have to be
> a nontransactional update, which means it'd be out of sync if the ALTER
> rolls back after making it.  That cure seems hardly better than the
> disease.
> 
> I seem to recall some prior discussions about rearranging the
> representation of sequences to allow separation of transactional and
> nontransactional updates, but I don't remember if there were any
> non-cosmetic reasons to do it.  This one seems pretty cosmetic ...

The reason we were exploring that at all was because somebody wanted to
be able to get all the current values from sequences in a single query.
So we wanted to group them all in a single catalog, but that required
non-transactional updates to it.

I am amused by the fact that we store the sequence name in the sequence
itself though.

-- 
Alvaro Herrera                 http://www.amazon.com/gp/registry/CTMLCN8V17R4
www.google.com: interfaz de línea de órdenes para la web.

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-09-26 14:31:54
Subject: Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field
Previous:From: Tom LaneDate: 2007-09-26 14:10:38
Subject: Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group