Re: Modifying FK constraints

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Modifying FK constraints
Дата
Msg-id 41924E6C.8050400@archonet.com
обсуждение исходный текст
Ответ на Modifying FK constraints  ("Oleg Lebedev" <oleglebedev@waterford.org>)
Список pgsql-general
Oleg Lebedev wrote:
> Greetings.
>
> Is it possible to modify a foreign key constraint and force it to
> cascade on update? If there is no such SQL command, then is it possible
> to update some system tables to accomplish this?

BEGIN;
ALTER TABLE t1 DROP CONSTRAINT ...
ALTER TABLE t1 ADD CONSTRAINT ...
COMMIT;

Note that this will trigger a re-examination of all the values to check
the constraint is valid.

Also you may have to quote constraint names. If they are generated as $1
you will need to refer to them as "$1".

Full details in the "SQL Commands" chapter under "ALTER TABLE"
--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: "Oleg Lebedev"
Дата:
Сообщение: Modifying FK constraints
Следующее
От: Mike Nolan
Дата:
Сообщение: Re: Important Info on comp.databases.postgresql.general