Re: pg_dump serial UNIQUE NOT NULL PRIMARY KEY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Hipp <Michael(at)Hipp(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump serial UNIQUE NOT NULL PRIMARY KEY
Date: 2005-04-22 22:13:40
Message-ID: 18178.1114208020@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Hipp <Michael(at)Hipp(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Roussel 2005-04-22 22:27:46 Re: libpq Unicode support?
Previous Message Tom Lane 2005-04-22 22:10:58 Re: libpq Unicode support?