Re: ALTER TABLE -- how to add ON DELETE CASCADE?

Поиск
Список
Период
Сортировка
От felix@crowfix.com
Тема Re: ALTER TABLE -- how to add ON DELETE CASCADE?
Дата
Msg-id 20060307224214.GA21890@crowfix.com
обсуждение исходный текст
Ответ на Re: ALTER TABLE -- how to add ON DELETE CASCADE?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: ALTER TABLE -- how to add ON DELETE CASCADE?  (Jim Nasby <jnasby@pervasive.com>)
Список pgsql-general
On Tue, Mar 07, 2006 at 05:36:37PM -0500, Tom Lane wrote:
> felix@crowfix.com writes:
> >     ALTER TABLE A COLUMN AA ADD CONSTRAINT DELETE ON CASCADE
>
> You're missing the specification of the foreign key, not to mention
> spelling the CASCADE clause backwards.  Try
>
> ALTER TABLE A ADD FOREIGN KEY(AA) REFERENCES B(BB) ON DELETE CASCADE

Got it right in the Subject: and my many attempts, just not in the
body :-)

The column already had the foreign key, I never thought to add it
again.  I was only thinking of modifying the minimum necessary.

Thanks.

--
            ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
     Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ALTER TABLE -- how to add ON DELETE CASCADE?
Следующее
От: David Wall
Дата:
Сообщение: reindexdb script required in 8.1?