diff options
| author | Marc G. Fournier | 1997-04-02 18:24:52 +0000 |
|---|---|---|
| committer | Marc G. Fournier | 1997-04-02 18:24:52 +0000 |
| commit | a51df14a6927933ba576850a50125fccf283a175 (patch) | |
| tree | 0c498bc3a1e1b0e5cc42975aad9f1d1d3b0da8b4 /src/backend/tcop | |
| parent | 17b5bd33e415404734d9f904615a54814b80900b (diff) | |
From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
Subject: [HACKERS] Patch: SET var TO 'val'
Here is a patch that adds a "SET variable TO 'somevalue'" capability
to the parser, and then calls the SetPGVariable() function (which does
just issue a elog(NOTICE) to see whether it works).
That's the framework for adding timezone/date format/language/...
stuff.
Diffstat (limited to 'src/backend/tcop')
| -rw-r--r-- | src/backend/tcop/utility.c | 15 | ||||
| -rw-r--r-- | src/backend/tcop/variable.c | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 7511b154a61..ec4c7c68aef 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.13 1997/04/02 04:06:32 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.14 1997/04/02 18:23:34 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -44,6 +44,7 @@ #include "rewrite/rewriteDefine.h" #include "tcop/tcopdebug.h" #include "tcop/dest.h" +#include "tcop/variable.h" #include "tcop/utility.h" #include "fmgr.h" /* For load_file() */ @@ -634,7 +635,17 @@ ProcessUtility(Node *parsetree, beginRecipe(stmt); } break; - + + /* ******************************** + * set variable statements + *********************************/ + case T_VariableSetStmt: + { + VariableSetStmt *n = (VariableSetStmt *) parsetree; + SetPGVariable(n->name, n->value); + commandTag = "SET_VARIABLE"; + } + break; /* ******************************** * default diff --git a/src/backend/tcop/variable.c b/src/backend/tcop/variable.c index 6f279897556..e3041361394 100644 --- a/src/backend/tcop/variable.c +++ b/src/backend/tcop/variable.c @@ -1,8 +1,10 @@ #include "postgres.h" #include "tcop/variable.h" -bool SetPGVariable(const char *varName, const char *value) +bool SetPGVariable(const char *name, const char *value) { + elog(NOTICE, "Variable %s set to \"%s\"", name, value); + return TRUE; } |
