diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-09-27 20:27:32 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-09-27 20:27:32 +0000 |
commit | d62a7ac6d39702f6df4d119d0d2e3ba7b382e203 (patch) | |
tree | 32c6f5d88e826a992dae8aeaabdee4bd54429d4b /src/backend/commands/variable.c | |
parent | 5a017b96ad4a5b02907c6cea651d711f8fca615a (diff) | |
download | postgresql-d62a7ac6d39702f6df4d119d0d2e3ba7b382e203.tar.gz postgresql-d62a7ac6d39702f6df4d119d0d2e3ba7b382e203.zip |
Massimo's SET FSYNC and SHOW PG_OPTIONS changes, without SET QUERY_LIMIT.
Diffstat (limited to 'src/backend/commands/variable.c')
-rw-r--r-- | src/backend/commands/variable.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index d34b97c90df..ffbe98b97ff 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -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 @@ -569,6 +601,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 } }; |