| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера