Re: ablilty to test record for foreign key before deleting the record?

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: ablilty to test record for foreign key before deleting the record?
Дата
Msg-id 20051115200401.GO44860@pervasive.com
обсуждение исходный текст
Ответ на ablilty to test record for foreign key before deleting the record?  (Nathan Clark <nathanc@abcsinc.com>)
Список pgsql-general
On Tue, Nov 15, 2005 at 10:52:30AM -0600, Nathan Clark wrote:
> Is there a way to check to see if a record has a foreign key, before I
> try to delete a record ?
> To check first to see if this record is tied to a foreign key before I
> try to change it, thus avoiding
> a foreign key error.

Well, you could always try selecting on the child table...

What are you actually trying to do? If you just want to avoid exposing
the error you're probably better off just trapping for it in plpgsql.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: clustering by partial indexes
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: PREPARE TRANSACTION and webapps