aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-05-17 01:19:19 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-05-17 01:19:19 +0000
commitf0811a74b37427d7ee5eee56b00f7f2ea323d7d6 (patch)
tree51a596c44fd21144383062aa7d2ce852ae270268 /src/backend/tcop/postgres.c
parentfa613fa1eafd8fd80272a31e8477ad9368c95dbb (diff)
downloadpostgresql-f0811a74b37427d7ee5eee56b00f7f2ea323d7d6.tar.gz
postgresql-f0811a74b37427d7ee5eee56b00f7f2ea323d7d6.zip
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.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index eaf626ace95..53bf45dce9c 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -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");
}
/*