Re: delete and select with IN clause issues
| От | Tom Lane |
|---|---|
| Тема | Re: delete and select with IN clause issues |
| Дата | |
| Msg-id | 24512.1162525800@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | delete and select with IN clause issues (Jeff Frost <jeff@frostconsultingllc.com>) |
| Ответы |
Re: delete and select with IN clause issues
|
| Список | pgsql-sql |
Jeff Frost <jeff@frostconsultingllc.com> writes:
> delete from visit where id not in (select distinct visit_id from page_view);
> This yields the following error:
> ERROR: update or delete on "visit" violates foreign key constraint
> "fk34afd255fbacabec" on "page_view"
> DETAIL: Key (id)=(38635629) is still referenced from table "page_view".
This seems pretty darn weird. I am wondering about corrupt indexes ---
can you find the indicated key in either table if you set
enable_indexscan and enable_bitmapscan to 0?
Also, this is a long shot, but does visit by any chance have a cascading
deletion self-reference?
regards, tom lane
В списке pgsql-sql по дате отправления: