summaryrefslogtreecommitdiff
path: root/src/backend/commands/user.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/user.c
parentfa613fa1eafd8fd80272a31e8477ad9368c95dbb (diff)
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/user.c')
-rw-r--r--src/backend/commands/user.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index 405a7ceaa2b..5398d718b63 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -6,7 +6,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/commands/user.c,v 1.100 2002/04/28 00:36:38 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.101 2002/05/17 01:19:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -851,9 +851,7 @@ AlterUserSet(AlterUserSetStmt *stmt)
char repl_repl[Natts_pg_shadow];
int i;
- valuestr = (stmt->value
- ? ((A_Const *) lfirst(stmt->value))->val.val.str
- : NULL);
+ valuestr = flatten_set_variable_args(stmt->variable, stmt->value);
/*
* RowExclusiveLock is sufficient, because we don't need to update
@@ -874,7 +872,7 @@ AlterUserSet(AlterUserSetStmt *stmt)
repl_repl[i] = ' ';
repl_repl[Anum_pg_shadow_useconfig-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_shadow_useconfig-1] = 'n';
else