aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access
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/access
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/access')
-rw-r--r--src/backend/access/transam/xact.c5
-rw-r--r--src/backend/access/transam/xlog.c39
2 files changed, 14 insertions, 30 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index ca66b0afafa..d6176ec5c47 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.120 2002/04/01 03:34:25 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.121 2002/05/17 01:19:16 tgl Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
@@ -173,6 +173,7 @@
#include "storage/proc.h"
#include "storage/sinval.h"
#include "storage/smgr.h"
+#include "utils/guc.h"
#include "utils/inval.h"
#include "utils/memutils.h"
#include "utils/portal.h"
@@ -1002,6 +1003,7 @@ CommitTransaction(void)
RelationPurgeLocalRelation(true);
smgrDoPendingDeletes(true);
+ AtEOXact_GUC(true);
AtEOXact_SPI();
AtEOXact_gist();
AtEOXact_hash();
@@ -1104,6 +1106,7 @@ AbortTransaction(void)
RelationPurgeLocalRelation(false);
smgrDoPendingDeletes(false);
+ AtEOXact_GUC(false);
AtEOXact_SPI();
AtEOXact_gist();
AtEOXact_hash();
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index eca4a5de5f8..77ad566ba89 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.94 2002/05/09 13:30:24 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.95 2002/05/17 01:19:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3272,31 +3272,10 @@ xlog_outrec(char *buf, XLogRecord *record)
/*
- * GUC support routines
+ * GUC support
*/
-
-bool
-check_xlog_sync_method(const char *method)
-{
- if (strcasecmp(method, "fsync") == 0)
- return true;
-#ifdef HAVE_FDATASYNC
- if (strcasecmp(method, "fdatasync") == 0)
- return true;
-#endif
-#ifdef OPEN_SYNC_FLAG
- if (strcasecmp(method, "open_sync") == 0)
- return true;
-#endif
-#ifdef OPEN_DATASYNC_FLAG
- if (strcasecmp(method, "open_datasync") == 0)
- return true;
-#endif
- return false;
-}
-
-void
-assign_xlog_sync_method(const char *method)
+const char *
+assign_xlog_sync_method(const char *method, bool doit, bool interactive)
{
int new_sync_method;
int new_sync_bit;
@@ -3329,12 +3308,12 @@ assign_xlog_sync_method(const char *method)
#endif
else
{
- /* Can't get here unless guc.c screwed up */
- elog(ERROR, "bogus wal_sync_method %s", method);
- new_sync_method = 0; /* keep compiler quiet */
- new_sync_bit = 0;
+ return NULL;
}
+ if (!doit)
+ return method;
+
if (sync_method != new_sync_method || open_sync_bit != new_sync_bit)
{
/*
@@ -3359,6 +3338,8 @@ assign_xlog_sync_method(const char *method)
sync_method = new_sync_method;
open_sync_bit = new_sync_bit;
}
+
+ return method;
}