aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-04-12 20:38:31 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-04-12 20:38:31 +0000
commit9999f5a10e722c052006886b678995695001958a (patch)
treeee8b463a3369b5b4283ebb5aa893549de7c3fc45 /src/backend/utils
parent79b60cb132824a4939178b3ce9ded5c220a0f179 (diff)
downloadpostgresql-9999f5a10e722c052006886b678995695001958a.tar.gz
postgresql-9999f5a10e722c052006886b678995695001958a.zip
Checking to decide whether relations are system relations now depends
on the namespace not the name; pg_ is not a reserved prefix for table names anymore. From Fernando Nasser.
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/cache/inval.c13
-rw-r--r--src/backend/utils/cache/relcache.c6
2 files changed, 11 insertions, 8 deletions
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 6d397a7ba98..483c06bd6ac 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
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.49 2002/03/03 17:47:55 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.50 2002/04/12 20:38:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -456,12 +456,15 @@ PrepareForTupleInvalidation(Relation relation, HeapTuple tuple,
* We only need to worry about invalidation for tuples that are in
* system relations; user-relation tuples are never in catcaches and
* can't affect the relcache either.
- *
- * TOAST tuples can likewise be ignored here.
*/
- if (!IsSystemRelationName(NameStr(RelationGetForm(relation)->relname)))
+ if (!IsSystemRelation(relation))
return;
- if (IsToastRelationName(NameStr(RelationGetForm(relation)->relname)))
+ /*
+ * TOAST tuples can likewise be ignored here.
+ * Note that TOAST tables are considered system relations
+ * so they are not filtered by the above test.
+ */
+ if (IsToastRelation(relation))
return;
/*
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index fcdffa9132e..9a8e76f4926 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.159 2002/03/31 06:26:31 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.160 2002/04/12 20:38:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -183,7 +183,7 @@ do { \
elog(ERROR, "out of memory for relation descriptor cache"); \
/* used to give notice if found -- now just keep quiet */ \
nodentry->reldesc = RELATION; \
- if (RelationGetNamespace(RELATION) == PG_CATALOG_NAMESPACE) \
+ if (IsSystemNamespace(RelationGetNamespace(RELATION))) \
{ \
char *relname = RelationGetRelationName(RELATION); \
RelNameCacheEnt *namehentry; \
@@ -244,7 +244,7 @@ do { \
HASH_REMOVE, NULL); \
if (nodentry == NULL) \
elog(WARNING, "trying to delete a reldesc that does not exist."); \
- if (RelationGetNamespace(RELATION) == PG_CATALOG_NAMESPACE) \
+ if (IsSystemNamespace(RelationGetNamespace(RELATION))) \
{ \
char *relname = RelationGetRelationName(RELATION); \
RelNameCacheEnt *namehentry; \