Bug with rename bigserial column - Mailing list pgsql-general

From D. Dante Lorenso
Subject Bug with rename bigserial column
Date
Msg-id 40006F30.9050203@lorenso.com
Whole thread Raw
Responses Re: Bug with rename bigserial column
List pgsql-general
I just ran into a dump/restore problem with a bigserial column
on a renamed table.

BIGSERIAL columns when created will automagically create
the sequence also.  The sequence name is derived from
the table name and column name.

I had a table named 'audio_usage' and defined a column like this:

    ausage_id BIGSERIAL

who's default value was

    NEXTVAL('public.audio_usage_ausage_id_seq')

I then renamed my table to 'audio_file_usage'.  But the column
in the table remained unchanged. (that ok?)

Well, then I did a pg_dump and a pg_restore to migrate my dev
environment to qa.  Well, sure enough, the dump was fine,
but when the restore happened, the newly renamed table combined
with the same bigserial column automagically created it's
sequence, but the sequence created is different from the
default NEXTVAL which still refers to the original table_column_seq
name.

I've corrected the problem manually, but it does seem like a bug
somewhere.

Dante



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgresql dies without saying why
Next
From: "Cornelia Boenigk"
Date:
Subject: Problem with date calculations