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