update before drop causes OID problems in transaction? - Mailing list pgsql-sql

From Jeff Frost
Subject update before drop causes OID problems in transaction?
Date
Msg-id Pine.LNX.4.64.0603171434230.11424@discord.dyndns.org
Whole thread Raw
Responses Re: update before drop causes OID problems in transaction?
List pgsql-sql
Not sure if this is the best list for this issue, but I ran into something 
that I thought should work inside a transaction, but obviously PostgreSQL 
thought otherwise.

Postgres version is 8.1.3.  The transaction I wrote is basically:

BEGIN;
DROP RULE foo_audit_no_update ON foo_audit;

UPDATE foo_audit SET modified_by = 1
WHERE modified_by IS NULL;

I then copy the data out of foo_audit into some temporary tables,
drop foo_audit, alter table foo as I want it to be, then recreate foo_audit 
and all the triggers, functions, copy the data back into foo_audit from the 
temp tables and then

COMMIT;

After commit, I get a lovely:
 ERROR:  could not open relation with OID x

Is this expected?  To solve this, I simply moved my initial update outside the 
transaction.


-- 
Jeff Frost, Owner     <jeff@frostconsultingllc.com>
Frost Consulting, LLC     http://www.frostconsultingllc.com/
Phone: 650-780-7908    FAX: 650-649-1954


pgsql-sql by date:

Previous
From: Robert Treat
Date:
Subject: Re: in PlPgSQL function, how to use variable in a "select ...
Next
From: Tom Lane
Date:
Subject: Re: update before drop causes OID problems in transaction?