Re: adding on delete cascade constraint?

Поиск
Список
Период
Сортировка
От Jean-Christian Imbeault
Тема Re: adding on delete cascade constraint?
Дата
Msg-id 3F6AFE62.1030709@mega-bucks.co.jp
обсуждение исходный текст
Ответ на Re: adding on delete cascade constraint?  (Oliver Elphick <olly@lfix.co.uk>)
Ответы Re: adding on delete cascade constraint?  (Oliver Elphick <olly@lfix.co.uk>)
Re: adding on delete cascade constraint?  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Oliver Elphick wrote:

>>Foreign Key constraints: $1 FOREIGN KEY (pid) REFERENCES products(id) ON
>>UPDATE NO ACTION ON DELETE NO ACTION
>
> Drop the constraint; then add an amended one.

Ok, how do I drop the constraint, it has no name.

The documentation is rather poor on how to get the name of unamed
constraints:

"To remove a constraint you need to know its name. If you gave it a name
then that's easy. Otherwise the system assigned a generated name, which
you need to find out. The psql command \d tablename can be helpful here"

Secondly what is the correct syntax for adding a new constraint with ON
DELETE CASCADE?

Thanks,

Jean-Christian Imbeault



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

Предыдущее
От: Daniel Schuchardt
Дата:
Сообщение: Re: psql and blob
Следующее
От: Martin Marques
Дата:
Сообщение: Re: PostgreSQL versus MySQL