1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +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/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();

View File

@@ -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;
}