Re: Dump serials as serial -- not a sequence

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: Dump serials as serial -- not a sequence
Дата
Msg-id 1029616039.37296.27.camel@jester
обсуждение исходный текст
Ответ на Re: Dump serials as serial -- not a sequence  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
> The "serial primary key" hack in analyze.c does make that a bit ugly,
> but one simple answer is not to try to dump as a serial if there's a
> primary key on the column.



> A radical answer to that is to get rid of the implied UNIQUE constraint
> associated with SERIAL, thus making the combinations "serial unique" and
> "serial primary key" actually mean something.  I fear this won't fly :-(

My serials are almost always primary key's.  Wouldn't change anything in
that regard.

Docs suggest that UNIQUE and NOT NULL be applied to the column anyway.
http://www7.us.postgresql.org/users-lounge/docs/7.2/postgres/datatype.html#D

I'll see what others do.

> but it might be worth proposing.  If we have to maintain backwards
> compatibility, perhaps pg_dump could DROP the unique constraint just
> after making the table, and re-create it (possibly as a primary key
> rather than plain unique) when it makes indexes.

This seems really ugly, but would do the trick.




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: updated lock listing patch
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: updated lock listing patch