Re: pg_dump serial UNIQUE NOT NULL PRIMARY KEY

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: pg_dump serial UNIQUE NOT NULL PRIMARY KEY
Дата
Msg-id 20050422220454.GA94766@winnie.fuhr.org
обсуждение исходный текст
Ответ на pg_dump serial UNIQUE NOT NULL PRIMARY KEY  (Michael Hipp <Michael@Hipp.com>)
Список pgsql-general
On Fri, Apr 22, 2005 at 04:44:05PM -0500, Michael Hipp wrote:
>
> 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,
>
> The documentation seems to say that 'serial NOT NULL' is not at all the
> same as 'serial PRIMARY KEY':

Later in the dump file you should see something like this:

ALTER TABLE ONLY cases
    ADD CONSTRAINT cases_pkey PRIMARY KEY (id);

Presumably that's because adding the primary key constraint after
populating the table is more efficient than populating the table
with the constraint (and the associated index) in place.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

В списке pgsql-general по дате отправления:

Предыдущее
От: David Roussel
Дата:
Сообщение: Re: PHP and Postgresql on Windows
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: libpq Unicode support?