Re: Adding Foreign Key Constraint To Existing Table

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Adding Foreign Key Constraint To Existing Table
Дата
Msg-id alpine.LNX.2.00.1107011502460.31349@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Adding Foreign Key Constraint To Existing Table  (Thom Brown <thom@linux.com>)
Список pgsql-general
On Fri, 1 Jul 2011, Thom Brown wrote:

> By the way, rather than dropping the foreign key then recreating it, you
> could always do this:
>
> ALTER TABLE tablename DISABLE TRIGGER ALL;
>
> Then it would ignore the foreign key trigger and you could put in
> mischievous values... but remember to enable it again (replace DISABLE
> with ENABLE).  You'll have to be a superuser to do it though.

Thom,

   Valuable information, thanks. I try to get the table structure correct
before loading it into a database. In this case I was copying structure
(with minor mods) from an existing environmental database and it took me a
while to notice the original authors used synthetic keys when they are not
needed. So, I got rid of those keys.

Rich

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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: Adding Foreign Key Constraint To Existing Table
Следующее
От: David Johnston
Дата:
Сообщение: Re: Adding Foreign Key Constraint To Existing Table