aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/utility.c
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/tcop/utility.c
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/tcop/utility.c')
-rw-r--r--src/backend/tcop/utility.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index 7e2be17edea..77dfe4a2365 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.147 2002/04/12 09:17:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.148 2002/04/12 20:38:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -127,7 +127,7 @@ CheckDropPermissions(RangeVar *rel, char rightkind)
elog(ERROR, "you do not own %s \"%s\"",
rentry->name, rel->relname);
- if (!allowSystemTableMods && IsSystemRelationName(rel->relname))
+ if (!allowSystemTableMods && IsSystemClass(classform))
elog(ERROR, "%s \"%s\" is a system %s",
rentry->name, rel->relname, rentry->name);
@@ -153,7 +153,8 @@ CheckOwnership(RangeVar *rel, bool noCatalogs)
if (noCatalogs)
{
- if (!allowSystemTableMods && IsSystemRelationName(rel->relname))
+ if (!allowSystemTableMods &&
+ IsSystemClass((Form_pg_class) GETSTRUCT(tuple)))
elog(ERROR, "relation \"%s\" is a system catalog",
rel->relname);
}
@@ -791,15 +792,6 @@ ProcessUtility(Node *parsetree,
{
case INDEX:
relname = (char *) stmt->relation->relname;
- if (IsSystemRelationName(relname))
- {
- if (!allowSystemTableMods)
- elog(ERROR, "\"%s\" is a system index. call REINDEX under standalone postgres with -O -P options",
- relname);
- if (!IsIgnoringSystemIndexes())
- elog(ERROR, "\"%s\" is a system index. call REINDEX under standalone postgres with -P -O options",
- relname);
- }
CheckOwnership(stmt->relation, false);
ReindexIndex(stmt->relation, stmt->force);
break;
@@ -809,10 +801,6 @@ ProcessUtility(Node *parsetree,
break;
case DATABASE:
relname = (char *) stmt->name;
- if (!allowSystemTableMods)
- elog(ERROR, "must be called under standalone postgres with -O -P options");
- if (!IsIgnoringSystemIndexes())
- elog(ERROR, "must be called under standalone postgres with -P -O options");
ReindexDatabase(relname, stmt->force, false);
break;
}