Add new postgres -O option to allow system table structure changes.
This commit is contained in:
parent
62a7754e1a
commit
58118db39d
@ -7,7 +7,7 @@
|
|||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.55 1999/02/13 23:14:52 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.56 1999/03/17 22:52:45 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -182,7 +182,7 @@ static char *relname; /* current relation name */
|
|||||||
Form_pg_attribute attrtypes[MAXATTR]; /* points to attribute info */
|
Form_pg_attribute attrtypes[MAXATTR]; /* points to attribute info */
|
||||||
static char *values[MAXATTR]; /* cooresponding attribute values */
|
static char *values[MAXATTR]; /* cooresponding attribute values */
|
||||||
int numattr; /* number of attributes for cur. rel */
|
int numattr; /* number of attributes for cur. rel */
|
||||||
extern int fsyncOff; /* do not fsync the database */
|
extern bool disableFsync; /* do not fsync the database */
|
||||||
|
|
||||||
/* The test for HAVE_SIGSETJMP fails on Linux 2.0.x because the test
|
/* The test for HAVE_SIGSETJMP fails on Linux 2.0.x because the test
|
||||||
* explicitly disallows sigsetjmp being a #define, which is how it
|
* explicitly disallows sigsetjmp being a #define, which is how it
|
||||||
@ -335,7 +335,7 @@ BootstrapMain(int argc, char *argv[])
|
|||||||
Noversion = true;
|
Noversion = true;
|
||||||
break;
|
break;
|
||||||
case 'F':
|
case 'F':
|
||||||
fsyncOff = true;
|
disableFsync = true;
|
||||||
break;
|
break;
|
||||||
case 'O':
|
case 'O':
|
||||||
override = true;
|
override = true;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* NOTES
|
||||||
* See acl.h.
|
* See acl.h.
|
||||||
@ -38,6 +38,7 @@
|
|||||||
#include "utils/memutils.h"
|
#include "utils/memutils.h"
|
||||||
#include "utils/syscache.h"
|
#include "utils/syscache.h"
|
||||||
#include "utils/tqual.h"
|
#include "utils/tqual.h"
|
||||||
|
#include "miscadmin.h"
|
||||||
|
|
||||||
static int32 aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode);
|
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.)
|
* themselves from themselves.)
|
||||||
*/
|
*/
|
||||||
if (((mode & ACL_WR) || (mode & ACL_AP)) &&
|
if (((mode & ACL_WR) || (mode & ACL_AP)) &&
|
||||||
IsSystemRelationName(relname) &&
|
!allowSystemTableMods && IsSystemRelationName(relname) &&
|
||||||
!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)
|
!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)
|
||||||
{
|
{
|
||||||
elog(DEBUG, "pg_aclcheck: catalog update to \"%s\": permission denied",
|
elog(DEBUG, "pg_aclcheck: catalog update to \"%s\": permission denied",
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* INTERFACE ROUTINES
|
||||||
@ -195,7 +195,7 @@ heap_create(char *relname,
|
|||||||
*/
|
*/
|
||||||
AssertArg(natts > 0);
|
AssertArg(natts > 0);
|
||||||
|
|
||||||
if (relname && IsSystemRelationName(relname) && IsNormalProcessingMode())
|
if (relname && !allowSystemTableMods && IsSystemRelationName(relname) && IsNormalProcessingMode())
|
||||||
{
|
{
|
||||||
elog(ERROR, "Illegal class name '%s'"
|
elog(ERROR, "Illegal class name '%s'"
|
||||||
"\n\tThe 'pg_' name prefix is reserved for system catalogs",
|
"\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. */
|
/* 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",
|
elog(ERROR, "System relation '%s' cannot be destroyed",
|
||||||
&rel->rd_rel->relname);
|
&rel->rd_rel->relname);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* NOTES
|
||||||
* The PortalExecutorHeapMemory crap needs to be eliminated
|
* 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.
|
* 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",
|
elog(ERROR, "PerformAddAttribute: class \"%s\" is a system catalog",
|
||||||
relationName);
|
relationName);
|
||||||
#ifndef NO_SECURITY
|
#ifndef NO_SECURITY
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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.
|
* 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",
|
elog(ERROR, "renameatt: class \"%s\" is a system catalog",
|
||||||
relname);
|
relname);
|
||||||
#ifndef NO_SECURITY
|
#ifndef NO_SECURITY
|
||||||
@ -207,11 +207,11 @@ renamerel(char *oldrelname, char *newrelname)
|
|||||||
newpath[MAXPGPATH];
|
newpath[MAXPGPATH];
|
||||||
Relation irelations[Num_pg_class_indices];
|
Relation irelations[Num_pg_class_indices];
|
||||||
|
|
||||||
if (IsSystemRelationName(oldrelname))
|
if (!allowSystemTableMods && IsSystemRelationName(oldrelname))
|
||||||
elog(ERROR, "renamerel: system relation \"%s\" not renamed",
|
elog(ERROR, "renamerel: system relation \"%s\" not renamed",
|
||||||
oldrelname);
|
oldrelname);
|
||||||
|
|
||||||
if (IsSystemRelationName(newrelname))
|
if (!allowSystemTableMods && IsSystemRelationName(newrelname))
|
||||||
elog(ERROR, "renamerel: Illegal class name: \"%s\" -- pg_ is reserved for system catalogs",
|
elog(ERROR, "renamerel: Illegal class name: \"%s\" -- pg_ is reserved for system catalogs",
|
||||||
newrelname);
|
newrelname);
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ CreateTrigger(CreateTrigStmt *stmt)
|
|||||||
int found = 0;
|
int found = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (IsSystemRelationName(stmt->relname))
|
if (!allowSystemTableMods && IsSystemRelationName(stmt->relname))
|
||||||
elog(ERROR, "CreateTrigger: can't create trigger for system relation %s", stmt->relname);
|
elog(ERROR, "CreateTrigger: can't create trigger for system relation %s", stmt->relname);
|
||||||
|
|
||||||
#ifndef NO_SECURITY
|
#ifndef NO_SECURITY
|
||||||
|
@ -242,7 +242,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.81 1999/03/17 21:02:50 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.82 1999/03/17 22:52:57 momjian Exp $
|
||||||
*
|
*
|
||||||
* HISTORY
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Id: fd.c,v 1.37 1999/02/13 23:18:05 momjian Exp $
|
* $Id: fd.c,v 1.38 1999/03/17 22:53:06 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES:
|
* NOTES:
|
||||||
*
|
*
|
||||||
@ -168,9 +168,7 @@ static long pg_nofile(void);
|
|||||||
int
|
int
|
||||||
pg_fsync(int fd)
|
pg_fsync(int fd)
|
||||||
{
|
{
|
||||||
extern int fsyncOff;
|
return disableFsync ? 0 : fsync(fd);
|
||||||
|
|
||||||
return fsyncOff ? 0 : fsync(fd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define fsync pg_fsync
|
#define fsync pg_fsync
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.104 1999/02/21 03:49:27 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.105 1999/03/17 22:53:18 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* this is the "main" module of the postgres backend and
|
* this is the "main" module of the postgres backend and
|
||||||
@ -917,6 +917,7 @@ usage(char *progname)
|
|||||||
#ifdef LOCK_MGR_DEBUG
|
#ifdef LOCK_MGR_DEBUG
|
||||||
fprintf(stderr, "\t-K \t\tset locking debug level [0|1|2]\n");
|
fprintf(stderr, "\t-K \t\tset locking debug level [0|1|2]\n");
|
||||||
#endif
|
#endif
|
||||||
|
fprintf(stderr, "\t-O \t\tallow system table structure changes\n");
|
||||||
fprintf(stderr, "\t-P port\t\tset port file descriptor\n");
|
fprintf(stderr, "\t-P port\t\tset port file descriptor\n");
|
||||||
fprintf(stderr, "\t-Q \t\tsuppress informational messages\n");
|
fprintf(stderr, "\t-Q \t\tsuppress informational messages\n");
|
||||||
fprintf(stderr, "\t-S buffers\tset amount of sort memory available\n");
|
fprintf(stderr, "\t-S buffers\tset amount of sort memory available\n");
|
||||||
@ -1017,7 +1018,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
|
|||||||
optind = 1; /* reset after postmaster usage */
|
optind = 1; /* reset after postmaster usage */
|
||||||
|
|
||||||
while ((flag = getopt(argc, argv,
|
while ((flag = getopt(argc, argv,
|
||||||
"A:B:CD:d:Eef:iK:Lm:MNo:P:pQS:st:v:x:FW:"))
|
"A:B:CD:d:Eef:iK:Lm:MNOo:P:pQS:st:v:x:FW:"))
|
||||||
!= EOF)
|
!= EOF)
|
||||||
switch (flag)
|
switch (flag)
|
||||||
{
|
{
|
||||||
@ -1096,7 +1097,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
|
|||||||
* turn off fsync
|
* turn off fsync
|
||||||
* --------------------
|
* --------------------
|
||||||
*/
|
*/
|
||||||
fsyncOff = 1;
|
disableFsync = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
@ -1168,6 +1169,14 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
|
|||||||
StrNCpy(OutputFileName, optarg, MAXPGPATH);
|
StrNCpy(OutputFileName, optarg, MAXPGPATH);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'O':
|
||||||
|
/* --------------------
|
||||||
|
* allow system table structure modifications
|
||||||
|
* --------------------
|
||||||
|
*/
|
||||||
|
allowSystemTableMods = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'p': /* started by postmaster */
|
case 'p': /* started by postmaster */
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* p - special flag passed if backend was forked
|
* p - special flag passed if backend was forked
|
||||||
@ -1522,7 +1531,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
|
|||||||
if (!IsUnderPostmaster)
|
if (!IsUnderPostmaster)
|
||||||
{
|
{
|
||||||
puts("\nPOSTGRES backend interactive interface ");
|
puts("\nPOSTGRES backend interactive interface ");
|
||||||
puts("$Revision: 1.104 $ $Date: 1999/02/21 03:49:27 $\n");
|
puts("$Revision: 1.105 $ $Date: 1999/03/17 22:53:18 $\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.58 1999/03/16 03:24:17 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.59 1999/03/17 22:53:19 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -187,7 +187,7 @@ ProcessUtility(Node *parsetree,
|
|||||||
foreach(arg, args)
|
foreach(arg, args)
|
||||||
{
|
{
|
||||||
relname = strVal(lfirst(arg));
|
relname = strVal(lfirst(arg));
|
||||||
if (IsSystemRelationName(relname))
|
if (!allowSystemTableMods && IsSystemRelationName(relname))
|
||||||
elog(ERROR, "class \"%s\" is a system catalog",
|
elog(ERROR, "class \"%s\" is a system catalog",
|
||||||
relname);
|
relname);
|
||||||
rel = heap_openr(relname);
|
rel = heap_openr(relname);
|
||||||
@ -268,7 +268,7 @@ ProcessUtility(Node *parsetree,
|
|||||||
CHECK_IF_ABORTED();
|
CHECK_IF_ABORTED();
|
||||||
|
|
||||||
relname = stmt->relname;
|
relname = stmt->relname;
|
||||||
if (IsSystemRelationName(relname))
|
if (!allowSystemTableMods && IsSystemRelationName(relname))
|
||||||
elog(ERROR, "class \"%s\" is a system catalog",
|
elog(ERROR, "class \"%s\" is a system catalog",
|
||||||
relname);
|
relname);
|
||||||
#ifndef NO_SECURITY
|
#ifndef NO_SECURITY
|
||||||
@ -457,7 +457,7 @@ ProcessUtility(Node *parsetree,
|
|||||||
{
|
{
|
||||||
case INDEX:
|
case INDEX:
|
||||||
relname = stmt->name;
|
relname = stmt->name;
|
||||||
if (IsSystemRelationName(relname))
|
if (!allowSystemTableMods && IsSystemRelationName(relname))
|
||||||
elog(ERROR, "class \"%s\" is a system catalog index",
|
elog(ERROR, "class \"%s\" is a system catalog index",
|
||||||
relname);
|
relname);
|
||||||
#ifndef NO_SECURITY
|
#ifndef NO_SECURITY
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.27 1999/02/13 23:20:00 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.28 1999/03/17 22:53:19 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Globals used all over the place should be declared here and not
|
* Globals used all over the place should be declared here and not
|
||||||
@ -82,7 +82,8 @@ char DateFormat[20] = "%d-%m-%Y"; /* mjl: sizes! or better
|
|||||||
* malloc? XXX */
|
* malloc? XXX */
|
||||||
char FloatFormat[20] = "%f";
|
char FloatFormat[20] = "%f";
|
||||||
|
|
||||||
int fsyncOff = 0;
|
bool disableFsync = false;
|
||||||
|
bool allowSystemTableMods = false;
|
||||||
int SortMem = 512;
|
int SortMem = 512;
|
||||||
|
|
||||||
char *IndexedCatalogNames[] = {
|
char *IndexedCatalogNames[] = {
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.57 1999/01/28 15:28:40 wieck Exp $
|
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.58 1999/03/17 22:53:25 momjian Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -398,7 +398,7 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
PGSQL_OPT="-o /dev/null -F -Q -D$PGDATA"
|
PGSQL_OPT="-o /dev/null -O -F -Q -D$PGDATA"
|
||||||
|
|
||||||
# If the COPY is first, the VACUUM generates an error, so we vacuum first
|
# If the COPY is first, the VACUUM generates an error, so we vacuum first
|
||||||
echo "Vacuuming template1"
|
echo "Vacuuming template1"
|
||||||
@ -408,7 +408,7 @@ echo "COPY pg_shadow TO '$PGDATA/pg_pwd' USING DELIMITERS '\\t'" | \
|
|||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
echo "Creating public pg_user view"
|
echo "Creating public pg_user view"
|
||||||
echo "CREATE TABLE xpg_user ( \
|
echo "CREATE TABLE pg_user ( \
|
||||||
usename name, \
|
usename name, \
|
||||||
usesysid int4, \
|
usesysid int4, \
|
||||||
usecreatedb bool, \
|
usecreatedb bool, \
|
||||||
@ -418,12 +418,6 @@ echo "CREATE TABLE xpg_user ( \
|
|||||||
passwd text, \
|
passwd text, \
|
||||||
valuntil abstime);" | postgres $PGSQL_OPT template1 > /dev/null
|
valuntil abstime);" | postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
#move it into pg_user
|
|
||||||
echo "UPDATE pg_class SET relname = 'pg_user' WHERE relname = 'xpg_user';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
echo "UPDATE pg_type SET typname = 'pg_user' WHERE typname = 'xpg_user';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
mv $PGDATA/base/template1/xpg_user $PGDATA/base/template1/pg_user
|
|
||||||
|
|
||||||
echo "CREATE RULE \"_RETpg_user\" AS ON SELECT TO pg_user DO INSTEAD \
|
echo "CREATE RULE \"_RETpg_user\" AS ON SELECT TO pg_user DO INSTEAD \
|
||||||
SELECT usename, usesysid, usecreatedb, usetrace, \
|
SELECT usename, usesysid, usecreatedb, usetrace, \
|
||||||
@ -434,16 +428,10 @@ echo "REVOKE ALL on pg_shadow FROM public" | \
|
|||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
echo "Creating view pg_rules"
|
echo "Creating view pg_rules"
|
||||||
echo "CREATE TABLE xpg_rules ( \
|
echo "CREATE TABLE pg_rules ( \
|
||||||
tablename name, \
|
tablename name, \
|
||||||
rulename name, \
|
rulename name, \
|
||||||
definition text);" | postgres $PGSQL_OPT template1 > /dev/null
|
definition text);" | postgres $PGSQL_OPT template1 > /dev/null
|
||||||
#move it into pg_rules
|
|
||||||
echo "UPDATE pg_class SET relname = 'pg_rules' WHERE relname = 'xpg_rules';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
echo "UPDATE pg_type SET typname = 'pg_rules' WHERE typname = 'xpg_rules';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
mv $PGDATA/base/template1/xpg_rules $PGDATA/base/template1/pg_rules
|
|
||||||
|
|
||||||
echo "CREATE RULE \"_RETpg_rules\" AS ON SELECT TO pg_rules DO INSTEAD \
|
echo "CREATE RULE \"_RETpg_rules\" AS ON SELECT TO pg_rules DO INSTEAD \
|
||||||
SELECT C.relname AS tablename, \
|
SELECT C.relname AS tablename, \
|
||||||
@ -455,16 +443,10 @@ echo "CREATE RULE \"_RETpg_rules\" AS ON SELECT TO pg_rules DO INSTEAD \
|
|||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
echo "Creating view pg_views"
|
echo "Creating view pg_views"
|
||||||
echo "CREATE TABLE xpg_views ( \
|
echo "CREATE TABLE pg_views ( \
|
||||||
viewname name, \
|
viewname name, \
|
||||||
viewowner name, \
|
viewowner name, \
|
||||||
definition text);" | postgres $PGSQL_OPT template1 > /dev/null
|
definition text);" | postgres $PGSQL_OPT template1 > /dev/null
|
||||||
#move it into pg_views
|
|
||||||
echo "UPDATE pg_class SET relname = 'pg_views' WHERE relname = 'xpg_views';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
echo "UPDATE pg_type SET typname = 'pg_views' WHERE typname = 'xpg_views';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
mv $PGDATA/base/template1/xpg_views $PGDATA/base/template1/pg_views
|
|
||||||
|
|
||||||
echo "CREATE RULE \"_RETpg_views\" AS ON SELECT TO pg_views DO INSTEAD \
|
echo "CREATE RULE \"_RETpg_views\" AS ON SELECT TO pg_views DO INSTEAD \
|
||||||
SELECT C.relname AS viewname, \
|
SELECT C.relname AS viewname, \
|
||||||
@ -476,18 +458,12 @@ echo "CREATE RULE \"_RETpg_views\" AS ON SELECT TO pg_views DO INSTEAD \
|
|||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
echo "Creating view pg_tables"
|
echo "Creating view pg_tables"
|
||||||
echo "CREATE TABLE xpg_tables ( \
|
echo "CREATE TABLE pg_tables ( \
|
||||||
tablename name, \
|
tablename name, \
|
||||||
tableowner name, \
|
tableowner name, \
|
||||||
hasindexes bool, \
|
hasindexes bool, \
|
||||||
hasrules bool, \
|
hasrules bool, \
|
||||||
hastriggers bool);" | postgres $PGSQL_OPT template1 > /dev/null
|
hastriggers bool);" | postgres $PGSQL_OPT template1 > /dev/null
|
||||||
#move it into pg_tables
|
|
||||||
echo "UPDATE pg_class SET relname = 'pg_tables' WHERE relname = 'xpg_tables';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
echo "UPDATE pg_type SET typname = 'pg_tables' WHERE typname = 'xpg_tables';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
mv $PGDATA/base/template1/xpg_tables $PGDATA/base/template1/pg_tables
|
|
||||||
|
|
||||||
echo "CREATE RULE \"_RETpg_tables\" AS ON SELECT TO pg_tables DO INSTEAD \
|
echo "CREATE RULE \"_RETpg_tables\" AS ON SELECT TO pg_tables DO INSTEAD \
|
||||||
SELECT C.relname AS tablename, \
|
SELECT C.relname AS tablename, \
|
||||||
@ -501,16 +477,10 @@ echo "CREATE RULE \"_RETpg_tables\" AS ON SELECT TO pg_tables DO INSTEAD \
|
|||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
echo "Creating view pg_indexes"
|
echo "Creating view pg_indexes"
|
||||||
echo "CREATE TABLE xpg_indexes ( \
|
echo "CREATE TABLE pg_indexes ( \
|
||||||
tablename name, \
|
tablename name, \
|
||||||
indexname name, \
|
indexname name, \
|
||||||
indexdef text);" | postgres $PGSQL_OPT template1 > /dev/null
|
indexdef text);" | postgres $PGSQL_OPT template1 > /dev/null
|
||||||
#move it into pg_indexes
|
|
||||||
echo "UPDATE pg_class SET relname = 'pg_indexes' WHERE relname = 'xpg_indexes';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
echo "UPDATE pg_type SET typname = 'pg_indexes' WHERE typname = 'xpg_indexes';" |\
|
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
|
||||||
mv $PGDATA/base/template1/xpg_indexes $PGDATA/base/template1/pg_indexes
|
|
||||||
|
|
||||||
echo "CREATE RULE \"_RETpg_indexes\" AS ON SELECT TO pg_indexes DO INSTEAD \
|
echo "CREATE RULE \"_RETpg_indexes\" AS ON SELECT TO pg_indexes DO INSTEAD \
|
||||||
SELECT C.relname AS tablename, \
|
SELECT C.relname AS tablename, \
|
||||||
@ -528,4 +498,3 @@ echo "copy pg_description from '$GLOBAL_DESCR'" | \
|
|||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
echo "vacuum analyze" | \
|
echo "vacuum analyze" | \
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: miscadmin.h,v 1.35 1999/02/13 23:20:46 momjian Exp $
|
* $Id: miscadmin.h,v 1.36 1999/03/17 22:53:30 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* some of the information in this file will be moved to
|
* some of the information in this file will be moved to
|
||||||
@ -94,7 +94,8 @@ extern char CTZName[];
|
|||||||
extern char FloatFormat[];
|
extern char FloatFormat[];
|
||||||
extern char DateFormat[];
|
extern char DateFormat[];
|
||||||
|
|
||||||
extern int fsyncOff;
|
extern bool disableFsync;
|
||||||
|
extern bool allowSystemTableMods;
|
||||||
extern int SortMem;
|
extern int SortMem;
|
||||||
|
|
||||||
extern Oid LastOidProcessed; /* for query rewrite */
|
extern Oid LastOidProcessed; /* for query rewrite */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.\" This is -*-nroff-*-
|
.\" This is -*-nroff-*-
|
||||||
.\" XXX standard disclaimer belongs here....
|
.\" XXX standard disclaimer belongs here....
|
||||||
.\" $Header: /cvsroot/pgsql/src/man/Attic/postgres.1,v 1.13 1999/02/18 05:26:34 momjian Exp $
|
.\" $Header: /cvsroot/pgsql/src/man/Attic/postgres.1,v 1.14 1999/03/17 22:53:31 momjian Exp $
|
||||||
.TH POSTGRESQL UNIX 12/08/96 PostgreSQL PostgreSQL
|
.TH POSTGRESQL UNIX 12/08/96 PostgreSQL PostgreSQL
|
||||||
.SH NAME
|
.SH NAME
|
||||||
postgres - the Postgres backend server
|
postgres - the Postgres backend server
|
||||||
@ -22,6 +22,9 @@ data_directory]
|
|||||||
.BR "-F"
|
.BR "-F"
|
||||||
]
|
]
|
||||||
[\c
|
[\c
|
||||||
|
.BR "-O"
|
||||||
|
]
|
||||||
|
[\c
|
||||||
.BR "-P"
|
.BR "-P"
|
||||||
filedes]
|
filedes]
|
||||||
[\c
|
[\c
|
||||||
@ -99,6 +102,9 @@ Disable automatic fsync() call after each transaction.
|
|||||||
This option improves performance, but an operating system crash
|
This option improves performance, but an operating system crash
|
||||||
while a transaction is in progress will probably cause data loss.
|
while a transaction is in progress will probably cause data loss.
|
||||||
.TP
|
.TP
|
||||||
|
.BR "-O"
|
||||||
|
Override restrictions, so system table structures can be modified(pg_*).
|
||||||
|
.TP
|
||||||
.BR "-P" " filedes"
|
.BR "-P" " filedes"
|
||||||
.IR "filedes"
|
.IR "filedes"
|
||||||
specifies the file descriptor that corresponds to the socket (port) on
|
specifies the file descriptor that corresponds to the socket (port) on
|
||||||
|
Loading…
x
Reference in New Issue
Block a user