I know that in 8.3 we have the new plan caching mechanism which fixes
this, but I am wondering if this particular problem was known:
alvherre=# delete from a where a = 2;
ERROR: update o delete en «a» viola la llave foránea «b_a_fkey» en «b»
DETAIL: La llave (a)=(2) todavía es referida desde la tabla «b».
alvherre=# drop index b_a;
DROP INDEX
alvherre=# delete from a where a = 2;
ERROR: could not open relation with OID 16433
CONTEXT: sentencia SQL: «SELECT 1 FROM ONLY "public"."b" x WHERE "a" = $1 FOR SHARE OF x»
(This is on 8.2) What is happening here -- are we caching the plan for
the FK check query?
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.