Re: BUG #2299: pg_dump error w/ renamed primary keys

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2299: pg_dump error w/ renamed primary keys
Дата
Msg-id 27850.1141511785@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2299: pg_dump error w/ renamed primary keys  ("Gavin Scott" <gavin@planetacetech.com>)
Список pgsql-bugs
"Gavin Scott" <gavin@planetacetech.com> writes:
> If you rename a primary key, pg_dump tries to recreate it with the original
> name.  Here is how to recreate:

>> CREATE TABLE foo ( id integer );
>> ALTER TABLE foo ADD CONSTRAINT foo_pkey PRIMARY KEY (id);
>> ALTER TABLE foo_pkey RENAME TO bar_pkey;

This is correct, as the controlling name is that of the constraint not
the index.  We really should forbid the above entirely, but it's not
a very high-priority issue.

(Somewhat higher priority is to add a RENAME CONSTRAINT capability;
that's on the TODO list.  There was a patch for this submitted recently
but it needs work...)

            regards, tom lane

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