Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key

Поиск
Список
Период
Сортировка
От Andreas Joseph Krogh
Тема Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key
Дата
Msg-id VisenaEmail.24.f70820f503f4392b.1591bc341a6@tc7-visena
обсуждение исходный текст
Ответ на Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Ответы Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key
Список pgsql-general
På tirsdag 20. desember 2016 kl. 11:02:27, skrev Achilleas Mantzios <achill@matrix.gatewaynet.com>:
On 20/12/2016 11:43, Andreas Joseph Krogh wrote:
[snip]
BEGIN;
ALTER TABLE person ADD CONSTRAINT person_pk PRIMARY KEY (entity_id);
alter table person drop constraint person_entity_id_key CASCADE;
alter table phone add CONSTRAINT phone_fk FOREIGN KEY (person_entity_id) REFERENCES person(entity_id);
alter table address add CONSTRAINT address_fk FOREIGN KEY (person_id) REFERENCES person(entity_id);
COMMIT;
 
Yea, I was hoping to avoid having to manually add the FK's to the referencing tables (34).
Is there really no way to accomplish this without DROP CONSTRAINT ...  CASCADE, hacking the system-catalogs or something?
 
Thanks.
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 
Вложения

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

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key