BUG #5374: NULLed SERIAL improperly dumped

From: "Wojciech Scigala" <postgresql(dot)org(at)wojtus(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5374: NULLed SERIAL improperly dumped
Date: 2010-03-12 23:37:02
Message-ID: 201003122337.o2CNb2Bq012104@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5374
Logged by: Wojciech Scigala
Email address: postgresql(dot)org(at)wojtus(dot)net
PostgreSQL version: 8.1.18
Operating system: Linux 2.6.18
Description: NULLed SERIAL improperly dumped
Details:

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.

Steps to reproduce:

CREATE TABLE bugtest ( nullserial SERIAL );

ALTER TABLE bugtest ALTER nullserial DROP NOT NULL;

INSERT INTO bugtest VALUES ( NULL );

Shell commands:
$ pg_dump -Fc -f dumpfile database
$ pg_restore -c -d database dumpile

Resulting error:
CONTEXT: COPY bugtest, line 1: "\N" pg_restore [archiver (db)] error
returned by PQendcopy: ERROR: null value in column "nullserial" violates
not-null constraint

Best regards,

Wojciech

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2010-03-13 00:48:24 Re: [BUGS] BUG #5021: ts_parse doesn't recognize email addresses with underscores
Previous Message gray.pg 2010-03-12 22:58:10 Re: BUG #5372: insert into fails with integer expression type char error