aboutsummaryrefslogtreecommitdiff
path: root/src/include/nodes/parsenodes.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-09-03 18:46:30 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-09-03 18:46:30 +0000
commite7889b83b7059e776f0a3d76bbbdd98687f4592c (patch)
treee0b51d43d089c38a1debbe9d9d15499e68a548dd /src/include/nodes/parsenodes.h
parentdd4594e332a86b563801b6bbed0a7d256dcd7e43 (diff)
downloadpostgresql-e7889b83b7059e776f0a3d76bbbdd98687f4592c.tar.gz
postgresql-e7889b83b7059e776f0a3d76bbbdd98687f4592c.zip
Support SET FROM CURRENT in CREATE/ALTER FUNCTION, ALTER DATABASE, ALTER ROLE.
(Actually, it works as a plain statement too, but I didn't document that because it seems a bit useless.) Unify VariableResetStmt with VariableSetStmt, and clean up some ancient cruft in the representation of same.
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r--src/include/nodes/parsenodes.h81
1 files changed, 40 insertions, 41 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 79449c55847..412fadac54e 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.352 2007/08/22 05:13:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.353 2007/09/03 18:46:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1051,6 +1051,42 @@ typedef struct CopyStmt
} CopyStmt;
/* ----------------------
+ * SET Statement (includes RESET)
+ *
+ * "SET var TO DEFAULT" and "RESET var" are semantically equivalent, but we
+ * preserve the distinction in VariableSetKind for CreateCommandTag().
+ * ----------------------
+ */
+typedef enum
+{
+ VAR_SET_VALUE, /* SET var = value */
+ VAR_SET_DEFAULT, /* SET var TO DEFAULT */
+ VAR_SET_CURRENT, /* SET var FROM CURRENT */
+ VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
+ VAR_RESET, /* RESET var */
+ VAR_RESET_ALL /* RESET ALL */
+} VariableSetKind;
+
+typedef struct VariableSetStmt
+{
+ NodeTag type;
+ VariableSetKind kind;
+ char *name; /* variable to be set */
+ List *args; /* List of A_Const nodes */
+ bool is_local; /* SET LOCAL? */
+} VariableSetStmt;
+
+/* ----------------------
+ * Show Statement
+ * ----------------------
+ */
+typedef struct VariableShowStmt
+{
+ NodeTag type;
+ char *name;
+} VariableShowStmt;
+
+/* ----------------------
* Create Table Statement
*
* NOTE: in the raw gram.y output, ColumnDef, Constraint, and FkConstraint
@@ -1264,8 +1300,7 @@ typedef struct AlterRoleSetStmt
{
NodeTag type;
char *role; /* role name */
- char *variable; /* GUC variable name */
- List *value; /* value for variable, or NIL for Reset */
+ VariableSetStmt *setstmt; /* SET or RESET subcommand */
} AlterRoleSetStmt;
typedef struct DropRoleStmt
@@ -1781,9 +1816,8 @@ typedef struct AlterDatabaseStmt
typedef struct AlterDatabaseSetStmt
{
NodeTag type;
- char *dbname;
- char *variable;
- List *value;
+ char *dbname; /* database name */
+ VariableSetStmt *setstmt; /* SET or RESET subcommand */
} AlterDatabaseSetStmt;
/* ----------------------
@@ -1849,41 +1883,6 @@ typedef struct CheckPointStmt
} CheckPointStmt;
/* ----------------------
- * Set Statement
- * ----------------------
- */
-
-typedef struct VariableSetStmt
-{
- NodeTag type;
- char *name;
- List *args;
- bool is_local; /* SET LOCAL */
-} VariableSetStmt;
-
-/* ----------------------
- * Show Statement
- * ----------------------
- */
-
-typedef struct VariableShowStmt
-{
- NodeTag type;
- char *name;
-} VariableShowStmt;
-
-/* ----------------------
- * Reset Statement
- * ----------------------
- */
-
-typedef struct VariableResetStmt
-{
- NodeTag type;
- char *name;
-} VariableResetStmt;
-
-/* ----------------------
* Discard Statement
* ----------------------
*/