Below is a short script which causes an error in the foreign key plan
caching. It appears to cause the error with or without the transaction,
but closing the connection between steps causes it to go away.

Can the cache be cleared after each statement?


Error reported:
        psql:/home/rbt/bugtest:18: ERROR:  could not open relation with
        OID 26353


Script:
        begin;
        
        create table a (col integer primary key);
        
        create table b (col integer primary key references a on update
        cascade on delete cascade);
        
        
        insert into a values (1);
        insert into b values (1);
        
        insert into a values (2);
        insert into b values (2);
        
        delete from a where col = 1;
        
        alter table b drop constraint b_pkey;
        
        delete from a where col = 2;
        
        commit;
Thu, 09 Oct 2003 12:43:01 -0400
Rod Taylor <rbt@rbt.ca>
Foreign key plan caching (too long!)