1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-30 06:01:21 +03:00

Add new postgres -O option to allow system table structure changes.

This commit is contained in:
Bruce Momjian
1999-03-17 22:53:31 +00:00
parent 62a7754e1a
commit 58118db39d
14 changed files with 57 additions and 71 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.39 1999/02/24 17:28:57 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.40 1999/03/17 22:52:51 momjian Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
@@ -308,7 +308,7 @@ PerformAddAttribute(char *relationName,
*
* normally, only the owner of a class can change its schema.
*/
if (IsSystemRelationName(relationName))
if (!allowSystemTableMods && IsSystemRelationName(relationName))
elog(ERROR, "PerformAddAttribute: class \"%s\" is a system catalog",
relationName);
#ifndef NO_SECURITY

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.21 1999/02/13 23:15:09 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.22 1999/03/17 22:52:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -81,7 +81,7 @@ renameatt(char *relname,
*
* normally, only the owner of a class can change its schema.
*/
if (IsSystemRelationName(relname))
if (!allowSystemTableMods && IsSystemRelationName(relname))
elog(ERROR, "renameatt: class \"%s\" is a system catalog",
relname);
#ifndef NO_SECURITY
@@ -207,11 +207,11 @@ renamerel(char *oldrelname, char *newrelname)
newpath[MAXPGPATH];
Relation irelations[Num_pg_class_indices];
if (IsSystemRelationName(oldrelname))
if (!allowSystemTableMods && IsSystemRelationName(oldrelname))
elog(ERROR, "renamerel: system relation \"%s\" not renamed",
oldrelname);
if (IsSystemRelationName(newrelname))
if (!allowSystemTableMods && IsSystemRelationName(newrelname))
elog(ERROR, "renamerel: Illegal class name: \"%s\" -- pg_ is reserved for system catalogs",
newrelname);

View File

@@ -66,7 +66,7 @@ CreateTrigger(CreateTrigStmt *stmt)
int found = 0;
int i;
if (IsSystemRelationName(stmt->relname))
if (!allowSystemTableMods && IsSystemRelationName(stmt->relname))
elog(ERROR, "CreateTrigger: can't create trigger for system relation %s", stmt->relname);
#ifndef NO_SECURITY