Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field - Mailing list pgsql-bugs

From ioguix
Subject Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field
Date
Msg-id 46FA480F.8000104@free.fr
Whole thread Raw
In response to Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field  (Bruce Momjian <bruce@momjian.us>)
Responses Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
I created this bug report using the pagila db sample (
http://pgfoundry.org/projects/dbsamples/ ). Here is how the sequence and
table are created :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CREATE SEQUENCE actor_actor_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;

CREATE TABLE actor (
    actor_id integer DEFAULT nextval('actor_actor_id_seq'::regclass) NOT
NULL,
    first_name character varying(45) NOT NULL,
    last_name character varying(45) NOT NULL,
    last_update timestamp without time zone DEFAULT now() NOT NULL
);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But I made another full trivial test to show this bug from pg8.1 so
using ALTER TABLE request (I don't have access on a pg8.3 presently) :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
postgres=# create DATABASE br3619;
CREATE DATABASE
postgres=# \c br3619
Vous êtes maintenant connecté à la base de données «br3619».
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)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


--
Guillaume 'ioguix' de Rorthais


Bruce Momjian a écrit :
> I am confused by this bug report.  Please show us the CREATE TABLE that
> goes with it.
>
> ---------------------------------------------------------------------------
>
> Guillaume 'ioguix' de Rorthais wrote:
>> The following bug has been logged online:
>>
>> Bug reference:      3619
>> Logged by:          Guillaume 'ioguix' de Rorthais
>> Email address:      ioguix@free.fr
>> PostgreSQL version: all - cvs
>> Operating system:   Linux
>> Description:        Renaming sequence does not update its 'sequence_name'
>> field
>> Details:
>>
>> When renaming a sequence, using ALTER SEQUENCE in pg8.3 or ALTER TABLE for
>> pg < 8.3, its sequence_name field is not updated.
>>
>> Here is how to produce this bug (output from psql 8.3devel):
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> pagila=# select sequence_name from actor_actor_id_seq_renamed;
>>    sequence_name
>> --------------------
>>  actor_actor_id_seq
>> (1 row)
>> pagila=# ALTER SEQUENCE actor_actor_id_seq RENAME TO
>> actor_actor_id_seq_renamed;
>> ALTER SEQUENCE
>> pagila=# select sequence_name from actor_actor_id_seq_renamed;
>>    sequence_name
>> --------------------
>>  actor_actor_id_seq
>> (1 row)
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> I guess the latest request should output actor_actor_id_seq_renamed,
>> shouldn't it ?
>>
>> --
>> ioguix
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 4: Have you searched our list archives?
>>
>>                http://archives.postgresql.org
>

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field
Next
From: Tom Lane
Date:
Subject: Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field