aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/dbcommands.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/commands/dbcommands.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/commands/dbcommands.c')
-rw-r--r--src/backend/commands/dbcommands.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 41f122767ad..bb53ad8b3bb 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.88 2002/04/27 21:24:34 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.89 2002/05/17 01:19:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -458,9 +458,7 @@ AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
char repl_null[Natts_pg_database];
char repl_repl[Natts_pg_database];
- valuestr = (stmt->value
- ? ((A_Const *) lfirst(stmt->value))->val.val.str
- : NULL);
+ valuestr = flatten_set_variable_args(stmt->variable, stmt->value);
rel = heap_openr(DatabaseRelationName, RowExclusiveLock);
ScanKeyEntryInitialize(&scankey, 0, Anum_pg_database_datname,
@@ -477,7 +475,7 @@ AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
MemSet(repl_repl, ' ', sizeof(repl_repl));
repl_repl[Anum_pg_database_datconfig-1] = 'r';
- if (strcmp(stmt->variable, "all")==0 && stmt->value == NULL)
+ if (strcmp(stmt->variable, "all")==0 && valuestr == NULL)
{
/* RESET ALL */
repl_null[Anum_pg_database_datconfig-1] = 'n';