Re: BUG #5374: NULLed SERIAL improperly dumped

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Wojciech Scigala" <postgresql(dot)org(at)wojtus(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5374: NULLed SERIAL improperly dumped
Date: 2010-03-13 05:12:54
Message-ID: 23467.1268457174@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Wojciech Scigala" <postgresql(dot)org(at)wojtus(dot)net> writes:
> If a SERIAL type is modified by ALTER TABLE .. DROP NOT NULL, backups made
> with pg_dump does not contain this change.

> Test were done on (unsupported) 8.1.18, I've checked release notes for
> 8.1.19 - no fix regarding this found.

Yeah, this is one of a number of reasons why we decided to stop using
the "SERIAL" construct in pg_dump output in 8.2 and up --- it's just not
capable of dealing with manual meddling with the serial column's
properties. This is not going to be changed in 8.1.x though. The best
recommendation before 8.2 is "don't do that".

FWIW, I believe that if you run 8.2 or later pg_dump against this
database and load the output into 8.2 or later server, the state of the
column will be restored properly. But that behavior depends on ALTER
SEQUENCE OWNED BY which is a command 8.1.x hasn't got; it was invented
specifically to deal with this type of situation.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Wes Sheldahl 2010-03-13 07:17:37 encoding warnings while intializing database.
Previous Message Bruce Momjian 2010-03-13 03:10:59 Re: Re: [BUGS] BUG #5021: ts_parse doesn't recognize email addresses with underscores