mirror of
https://github.com/postgres/postgres.git
synced 2025-11-15 03:41:20 +03:00
Add new postgres -O option to allow system table structure changes.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.19 1999/02/13 23:14:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.20 1999/03/17 22:52:47 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* See acl.h.
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "miscadmin.h"
|
||||
|
||||
static int32 aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode);
|
||||
|
||||
@@ -398,7 +399,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
|
||||
* themselves from themselves.)
|
||||
*/
|
||||
if (((mode & ACL_WR) || (mode & ACL_AP)) &&
|
||||
IsSystemRelationName(relname) &&
|
||||
!allowSystemTableMods && IsSystemRelationName(relname) &&
|
||||
!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)
|
||||
{
|
||||
elog(DEBUG, "pg_aclcheck: catalog update to \"%s\": permission denied",
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.75 1999/02/23 07:54:03 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.76 1999/03/17 22:52:48 momjian Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@@ -195,7 +195,7 @@ heap_create(char *relname,
|
||||
*/
|
||||
AssertArg(natts > 0);
|
||||
|
||||
if (relname && IsSystemRelationName(relname) && IsNormalProcessingMode())
|
||||
if (relname && !allowSystemTableMods && IsSystemRelationName(relname) && IsNormalProcessingMode())
|
||||
{
|
||||
elog(ERROR, "Illegal class name '%s'"
|
||||
"\n\tThe 'pg_' name prefix is reserved for system catalogs",
|
||||
@@ -1260,7 +1260,8 @@ heap_destroy_with_catalog(char *relname)
|
||||
* ----------------
|
||||
*/
|
||||
/* allow temp of pg_class? Guess so. */
|
||||
if (!istemp && IsSystemRelationName(RelationGetRelationName(rel)->data))
|
||||
if (!istemp &&
|
||||
!allowSystemTableMods && IsSystemRelationName(RelationGetRelationName(rel)->data))
|
||||
elog(ERROR, "System relation '%s' cannot be destroyed",
|
||||
&rel->rd_rel->relname);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user