diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-18 06:14:31 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-18 06:14:31 +0000 |
commit | 2467394ee1566e82d0314d12a0d1c0a5670a28c9 (patch) | |
tree | 57b87b8c181a9c3eb0f33bf775a5f31b9de8b890 /src/backend/utils/cache/inval.c | |
parent | 474875f4438ea0d18f9f4170117bc407e6812515 (diff) |
Tablespaces. Alternate database locations are dead, long live tablespaces.
There are various things left to do: contrib dbsize and oid2name modules
need work, and so does the documentation. Also someone should think about
COMMENT ON TABLESPACE and maybe RENAME TABLESPACE. Also initlocation is
dead, it just doesn't know it yet.
Gavin Sherry and Tom Lane.
Diffstat (limited to 'src/backend/utils/cache/inval.c')
-rw-r--r-- | src/backend/utils/cache/inval.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c index 7b00f0531e2..ea958a27b46 100644 --- a/src/backend/utils/cache/inval.c +++ b/src/backend/utils/cache/inval.c @@ -74,7 +74,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.61 2004/05/06 16:10:57 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.62 2004/06/18 06:13:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -308,7 +308,7 @@ AddRelcacheInvalidationMessage(InvalidationListHeader *hdr, /* We assume dbId need not be checked because it will never change */ /* relfilenode fields must be checked to support reassignment */ ProcessMessageList(hdr->rclist, - if (msg->rc.relId == relId && + if (msg->rc.relId == relId && RelFileNodeEquals(msg->rc.physId, physId)) return); /* OK, add the item */ @@ -555,14 +555,18 @@ PrepareForTupleInvalidation(Relation relation, HeapTuple tuple, databaseId = InvalidOid; else databaseId = MyDatabaseId; - rnode.tblNode = databaseId; /* XXX change for tablespaces */ + if (classtup->reltablespace) + rnode.spcNode = classtup->reltablespace; + else + rnode.spcNode = MyDatabaseTableSpace; + rnode.dbNode = databaseId; rnode.relNode = classtup->relfilenode; /* * Note: during a pg_class row update that assigns a new relfilenode - * value, we will be called on both the old and new tuples, and thus - * will broadcast invalidation messages showing both the old and new - * relfilenode values. This ensures that other backends will close - * smgr references to the old relfilenode file. + * or reltablespace value, we will be called on both the old and new + * tuples, and thus will broadcast invalidation messages showing both + * the old and new RelFileNode values. This ensures that other + * backends will close smgr references to the old file. */ } else if (tupleRelId == RelOid_pg_attribute) @@ -580,7 +584,8 @@ PrepareForTupleInvalidation(Relation relation, HeapTuple tuple, */ databaseId = MyDatabaseId; /* We assume no smgr cache flush is needed, either */ - rnode.tblNode = InvalidOid; + rnode.spcNode = InvalidOid; + rnode.dbNode = InvalidOid; rnode.relNode = InvalidOid; } else @@ -760,7 +765,11 @@ CacheInvalidateRelcacheByTuple(HeapTuple classTuple) databaseId = InvalidOid; else databaseId = MyDatabaseId; - rnode.tblNode = databaseId; /* XXX change for tablespaces */ + if (classtup->reltablespace) + rnode.spcNode = classtup->reltablespace; + else + rnode.spcNode = MyDatabaseTableSpace; + rnode.dbNode = databaseId; rnode.relNode = classtup->relfilenode; RegisterRelcacheInvalidation(databaseId, relationId, rnode); |