1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

Remove the recently added node types ReloptElem and OptionDefElem in favor

of adding optional namespace and action fields to DefElem.  Having three
node types that do essentially the same thing bloats the code and leads
to errors of confusion, such as in yesterday's bug report from Khee Chin.
This commit is contained in:
Tom Lane
2009-04-04 21:12:31 +00:00
parent c973051ae6
commit 090173a3f9
17 changed files with 208 additions and 333 deletions

View File

@@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.392 2009/02/24 10:06:35 petere Exp $
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.393 2009/04/04 21:12:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -50,14 +50,6 @@ typedef enum SortByNulls
SORTBY_NULLS_LAST
} SortByNulls;
/* Alter operations for generic options */
typedef enum AlterOptionOp
{
ALTER_OPT_DROP = -1,
ALTER_OPT_SET,
ALTER_OPT_ADD
} AlterOptionOp;
/*
* Grantable rights are encoded so that we can OR them together in a bitmask.
* The present representation of AclItem limits us to 16 distinct rights,
@@ -511,38 +503,32 @@ typedef struct IndexElem
} IndexElem;
/*
* DefElem -
* a definition (used in definition lists in the form of defname = arg)
* DefElem - a generic "name = value" option definition
*
* In some contexts the name can be qualified. Also, certain SQL commands
* allow a SET/ADD/DROP action to be attached to option settings, so it's
* convenient to carry a field for that too. (Note: currently, it is our
* practice that the grammar allows namespace and action only in statements
* where they are relevant; C code can just ignore those fields in other
* statements.)
*/
typedef enum DefElemAction
{
DEFELEM_UNSPEC, /* no action given */
DEFELEM_SET,
DEFELEM_ADD,
DEFELEM_DROP
} DefElemAction;
typedef struct DefElem
{
NodeTag type;
char *defnamespace; /* NULL if unqualified name */
char *defname;
Node *arg; /* a (Value *) or a (TypeName *) */
DefElemAction defaction; /* unspecified action, or SET/ADD/DROP */
} DefElem;
/*
* Option definition. Used in options definition lists, with optional alter
* operation.
*/
typedef struct OptionDefElem
{
NodeTag type;
AlterOptionOp alter_op; /* Alter operation: ADD/SET/DROP */
DefElem *def; /* The actual definition */
} OptionDefElem;
/*
* Reloption definition. As DefElem, with optional option namespace.
*/
typedef struct ReloptElem
{
NodeTag type;
char *nmspc;
char *optname;
Node *arg;
} ReloptElem;
/*
* LockingClause - raw representation of FOR UPDATE/SHARE options
*