1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

Merge the last few variable.c configuration variables into the generic

GUC support.  It's now possible to set datestyle, timezone, and
client_encoding from postgresql.conf and per-database or per-user
settings.  Also, implement rollback of SET commands that occur in a
transaction that later fails.  Create a SET LOCAL var = value syntax
that sets the variable only for the duration of the current transaction.
All per previous discussions in pghackers.
This commit is contained in:
Tom Lane
2002-05-17 01:19:19 +00:00
parent fa613fa1ea
commit f0811a74b3
42 changed files with 2641 additions and 1802 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.264 2002/05/10 20:22:13 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.265 2002/05/17 01:19:18 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@ -37,7 +37,6 @@
#include "access/xlog.h"
#include "commands/async.h"
#include "commands/trigger.h"
#include "commands/variable.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "libpq/pqsignal.h"
@ -1184,13 +1183,10 @@ PostgresMain(int argc, char *argv[], const char *username)
if (!IsUnderPostmaster)
{
ResetAllOptions(true);
InitializeGUCOptions();
potential_DataDir = getenv("PGDATA");
}
/* Check for PGDATESTYLE environment variable */
set_default_datestyle();
/* ----------------
* parse command line arguments
*
@ -1273,9 +1269,10 @@ PostgresMain(int argc, char *argv[], const char *username)
else
/*
* -d 0 allows user to prevent postmaster debug from
* propogating to backend.
* propagating to backend.
*/
SetConfigOption("server_min_messages", "notice", PGC_POSTMASTER, PGC_S_ARGV);
SetConfigOption("server_min_messages", "notice",
ctx, gucsource);
}
break;
@ -1292,7 +1289,7 @@ PostgresMain(int argc, char *argv[], const char *username)
/*
* Use european date formats.
*/
EuroDates = true;
SetConfigOption("datestyle", "euro", ctx, gucsource);
break;
case 'F':
@ -1691,7 +1688,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
puts("$Revision: 1.264 $ $Date: 2002/05/10 20:22:13 $\n");
puts("$Revision: 1.265 $ $Date: 2002/05/17 01:19:18 $\n");
}
/*