diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-17 01:19:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-05-17 01:19:19 +0000 |
commit | f0811a74b37427d7ee5eee56b00f7f2ea323d7d6 (patch) | |
tree | 51a596c44fd21144383062aa7d2ce852ae270268 /src/backend/access/transam/xlog.c | |
parent | fa613fa1eafd8fd80272a31e8477ad9368c95dbb (diff) | |
download | postgresql-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/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 39 |
1 files changed, 10 insertions, 29 deletions
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; } |