Re: pg_dump serial UNIQUE NOT NULL PRIMARY KEY - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_dump serial UNIQUE NOT NULL PRIMARY KEY
Date
Msg-id 18178.1114208020@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump serial UNIQUE NOT NULL PRIMARY KEY  (Michael Hipp <Michael@Hipp.com>)
List pgsql-general
Michael Hipp <Michael@Hipp.com> writes:
> Hello, I'm a fairly new user of PostgreSQL 8.0.2 and I'm creating a table like
> this:

> CREATE TABLE cases (
>      id serial PRIMARY KEY,

> Works fine, but when I pg_dump the database, what shows up in the dump is:

> CREATE TABLE cases (
>      id serial NOT NULL,

pg_dump prefers to add the PRIMARY KEY via an ALTER TABLE, after it's
got done loading data into the table.  This is basically a speed hack
(see the manual's advice about bulk data loading).

If you don't see an appropriate ALTER down near the end of the dump,
then you've got grounds for complaint ...

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: libpq Unicode support?
Next
From: David Roussel
Date:
Subject: Re: libpq Unicode support?