Re: Delete all records NOT referenced by Foreign Keys

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Delete all records NOT referenced by Foreign Keys
Дата
Msg-id 20031214002702.X31833@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Re: Delete all records NOT referenced by Foreign Keys  ("D. Dante Lorenso" <dante@lorenso.com>)
Ответы Re: Delete all records NOT referenced by Foreign Keys
Список pgsql-general
On Sun, 14 Dec 2003, D. Dante Lorenso wrote:

> PG already can block a delete when it knows that foreign key exists, so
> why can't I perform a query that says...
>
>     DELETE FROM tablename
>     WHERE FOREIGN_KEY_EXISTS(oid) IS FALSE;

That's fairly different from the checks that are performed for the foreign
keys which happen after the action has happened and errors to prevent the
action from being visible.  The where clause happens long before that.  If
the above has to check each referencing table for matching rows for each
row in tablename, I'd also expect it to perform poorly.

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

Предыдущее
От: Mike Coleman
Дата:
Сообщение: Re: make error Mac OS X (ar: illegal option -- s)
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Delete all records NOT referenced by Foreign Keys