Bug with rename bigserial column

From: "D(dot) Dante Lorenso" <dante(at)lorenso(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Bug with rename bigserial column
Date: 2004-01-10 21:31:28
Message-ID: 40006F30.9050203@lorenso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cornelia Boenigk 2004-01-10 22:36:01 Problem with date calculations
Previous Message Eric Freeman 2004-01-10 20:36:30 Any way to SELECT a list of table names?