diff options
Diffstat (limited to 'src/backend/commands/functioncmds.c')
-rw-r--r-- | src/backend/commands/functioncmds.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index a6768ab83c2..9e5d0b1095b 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.84 2007/09/03 00:39:15 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.85 2007/09/03 18:46:29 tgl Exp $ * * DESCRIPTION * These routines take the parse tree and pick out the @@ -354,7 +354,7 @@ interpret_func_volatility(DefElem *defel) } /* - * Update a proconfig value according to a list of SET and RESET items. + * Update a proconfig value according to a list of VariableSetStmt items. * * The input and result may be NULL to signify a null entry. */ @@ -365,33 +365,20 @@ update_proconfig_value(ArrayType *a, List *set_items) foreach(l, set_items) { - Node *sitem = (Node *) lfirst(l); + VariableSetStmt *sstmt = (VariableSetStmt *) lfirst(l); - if (IsA(sitem, VariableSetStmt)) + Assert(IsA(sstmt, VariableSetStmt)); + if (sstmt->kind == VAR_RESET_ALL) + a = NULL; + else { - VariableSetStmt *sstmt = (VariableSetStmt *) sitem; - - if (sstmt->args) - { - char *valuestr; + char *valuestr = ExtractSetVariableArgs(sstmt); - valuestr = flatten_set_variable_args(sstmt->name, sstmt->args); + if (valuestr) a = GUCArrayAdd(a, sstmt->name, valuestr); - } - else /* SET TO DEFAULT */ + else /* RESET */ a = GUCArrayDelete(a, sstmt->name); } - else if (IsA(sitem, VariableResetStmt)) - { - VariableResetStmt *rstmt = (VariableResetStmt *) sitem; - - if (strcmp(rstmt->name, "all") == 0) - a = NULL; /* RESET ALL */ - else - a = GUCArrayDelete(a, rstmt->name); - } - else - elog(ERROR, "unexpected node type: %d", nodeTag(sitem)); } return a; |