pg_dump serial UNIQUE NOT NULL PRIMARY KEY

Поиск
Список
Период
Сортировка
От Michael Hipp
Тема pg_dump serial UNIQUE NOT NULL PRIMARY KEY
Дата
Msg-id 42697025.2020603@Hipp.com
обсуждение исходный текст
Ответы Re: pg_dump serial UNIQUE NOT NULL PRIMARY KEY  (Michael Fuhr <mike@fuhr.org>)
Re: pg_dump serial UNIQUE NOT NULL PRIMARY KEY  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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':

( http://www.postgresql.org/docs/8.0/static/datatype.html#DATATYPE-SERIAL )

"Note:  Prior to PostgreSQL 7.3, serial implied UNIQUE. This is no longer
automatic. If you wish a serial column to be in a unique constraint or a
primary key, it must now be specified, same as with any other data type."

Any help appreciated,
Michael Hipp

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: libpq Unicode support?
Следующее
От: Karsten Hilbert
Дата:
Сообщение: Re: libpq Unicode support?