Re: pg_dump bug in 7.3.9 with sequences - Mailing list pgsql-hackers

From Dawid Kuroczko
Subject Re: pg_dump bug in 7.3.9 with sequences
Date
Msg-id 758d5e7f050203015316cdabb7@mail.gmail.com
Whole thread Raw
In response to Re: pg_dump bug in 7.3.9 with sequences  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-hackers
On Wed, 2 Feb 2005 19:04:04 -0300, Alvaro Herrera
<alvherre@dcc.uchile.cl> wrote:
> > It is not pilot error if PostgreSQL allows it. There is
> > nothing "illegal" about the above commands in their execution.
> > The pg_dump application should recognize that the object has
> > changed and react accordingly.
> 
> ISTM this is a bug, but it's not clear to me what is the solution.
> I can think of two:
> 
> 1. Changing the default is forbidden
> 2. When the default is changed, the dependency on the sequence is
> dropped, and the sequence itself is dropped.

In my humble opinion, the command:
ALTER TABLE ALTER COLUMN fooser SET DEFAULT nextval('aaa_seq');
should be equivalent to:
ALTER TABLE ALTER COLUMN fooser TYPE integer;
ALTER TABLE ALTER COLUMN fooser SET DEFAULT nextval('aaa_seq');

...ie, if we mess with 'default' it is no longer a serial, but a plain
integer with default sequence.
  Regards,    Dawid


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Crash when inserting gist records, or creating index
Next
From: ITAGAKI Takahiro
Date:
Subject: Re: [PATCHES] WAL: O_DIRECT and multipage-writer (+ memory leak)