From 3908473c809d5c24940faebfabdad673f4302178 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 8 Nov 2000 22:10:03 +0000 Subject: Make DROP TABLE rollback-able: postpone physical file delete until commit. (WAL logging for this is not done yet, however.) Clean up a number of really crufty things that are no longer needed now that DROP behaves nicely. Make temp table mapper do the right things when drop or rename affecting a temp table is rolled back. Also, remove "relation modified while in use" error check, in favor of locking tables at first reference and holding that lock throughout the statement. --- src/backend/access/transam/xlogutils.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/backend/access/transam/xlogutils.c') diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c index 1fdc7e83fb5..b6442787334 100644 --- a/src/backend/access/transam/xlogutils.c +++ b/src/backend/access/transam/xlogutils.c @@ -171,9 +171,8 @@ XLogOpenLogRelation(void) sprintf(RelationGetPhysicalRelationName(logRelation), "pg_log"); logRelation->rd_node.tblNode = InvalidOid; logRelation->rd_node.relNode = RelOid_pg_log; - logRelation->rd_unlinked = false; /* must exists */ logRelation->rd_fd = -1; - logRelation->rd_fd = smgropen(DEFAULT_SMGR, logRelation); + logRelation->rd_fd = smgropen(DEFAULT_SMGR, logRelation, false); if (logRelation->rd_fd < 0) elog(STOP, "XLogOpenLogRelation: failed to open pg_log"); LogRelation = logRelation; @@ -384,9 +383,9 @@ XLogOpenRelation(bool redo, RmgrId rmid, RelFileNode rnode) hentry->rdesc = res; - res->reldata.rd_unlinked = true; /* look smgropen */ res->reldata.rd_fd = -1; - res->reldata.rd_fd = smgropen(DEFAULT_SMGR, &(res->reldata)); + res->reldata.rd_fd = smgropen(DEFAULT_SMGR, &(res->reldata), + true /* allow failure */); } res->moreRecently = &(_xlrelarr[0]); -- cgit v1.2.3