mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
Massimo's SET FSYNC and SHOW PG_OPTIONS changes, without SET QUERY_LIMIT.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.67 1999/09/18 19:06:27 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.68 1999/09/27 20:26:58 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -134,7 +134,6 @@ static char *relname; /* current relation name */
|
||||
Form_pg_attribute attrtypes[MAXATTR]; /* points to attribute info */
|
||||
static char *values[MAXATTR]; /* cooresponding attribute values */
|
||||
int numattr; /* number of attributes for cur. rel */
|
||||
extern bool disableFsync; /* do not fsync the database */
|
||||
|
||||
int DebugMode;
|
||||
static GlobalMemory nogc = (GlobalMemory) NULL; /* special no-gc mem
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Routines for handling of 'SET var TO',
|
||||
* 'SHOW var' and 'RESET var' statements.
|
||||
*
|
||||
* $Id: variable.c,v 1.25 1999/07/17 20:16:54 momjian Exp $
|
||||
* $Id: variable.c,v 1.26 1999/09/27 20:27:03 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -11,11 +11,13 @@
|
||||
|
||||
#include "postgres.h"
|
||||
#include "access/xact.h"
|
||||
#include "catalog/pg_shadow.h"
|
||||
#include "commands/variable.h"
|
||||
#include "miscadmin.h"
|
||||
#include "optimizer/internal.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/trace.h"
|
||||
|
||||
#ifdef MULTIBYTE
|
||||
#include "mb/pg_wchar.h"
|
||||
@@ -528,6 +530,36 @@ reset_timezone()
|
||||
return TRUE;
|
||||
} /* reset_timezone() */
|
||||
|
||||
/*
|
||||
* Pg_options
|
||||
*/
|
||||
static bool
|
||||
parse_pg_options(const char *value)
|
||||
{
|
||||
if (!superuser()) {
|
||||
elog(ERROR, "Only users with superuser privilege can set pg_options");
|
||||
}
|
||||
parse_options((char *) value, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
static bool
|
||||
show_pg_options(void)
|
||||
{
|
||||
show_options();
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
static bool
|
||||
reset_pg_options(void)
|
||||
{
|
||||
if (!superuser()) {
|
||||
elog(ERROR, "Only users with superuser privilege can set pg_options");
|
||||
}
|
||||
read_pg_options(0);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
struct VariableParsers
|
||||
@@ -568,6 +600,9 @@ struct VariableParsers
|
||||
{
|
||||
"XactIsoLevel", parse_XactIsoLevel, show_XactIsoLevel, reset_XactIsoLevel
|
||||
},
|
||||
{
|
||||
"pg_options", parse_pg_options, show_pg_options, reset_pg_options
|
||||
},
|
||||
{
|
||||
NULL, NULL, NULL, NULL
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.36 1999/07/17 20:18:08 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.37 1999/09/27 20:27:09 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Globals used all over the place should be declared here and not
|
||||
@@ -76,7 +76,6 @@ char DateFormat[20] = "%d-%m-%Y"; /* mjl: sizes! or better
|
||||
* malloc? XXX */
|
||||
char FloatFormat[20] = "%f";
|
||||
|
||||
bool disableFsync = false;
|
||||
bool allowSystemTableMods = false;
|
||||
int SortMem = 512;
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ static char *opt_names[] = {
|
||||
"lock_debug_relid",
|
||||
"lock_read_priority", /* lock priority, see lock.c */
|
||||
"deadlock_timeout", /* deadlock timeout, see proc.c */
|
||||
"nofsync", /* turn fsync off */
|
||||
"syslog", /* use syslog for error messages */
|
||||
"hostlookup", /* enable hostname lookup in ps_status */
|
||||
"showportnumber", /* show port number in ps_status */
|
||||
@@ -405,6 +406,16 @@ read_pg_options(SIGNAL_ARGS)
|
||||
close(fd);
|
||||
}
|
||||
|
||||
void
|
||||
show_options(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<NUM_PG_OPTIONS; i++) {
|
||||
elog(NOTICE, "%s=%d", opt_names[i], pg_options[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
Reference in New Issue
Block a user