diff options
| author | Tom Lane | 2002-07-29 22:14:11 +0000 |
|---|---|---|
| committer | Tom Lane | 2002-07-29 22:14:11 +0000 |
| commit | ea4686e3e1f00910a19e18dd59f5c518345bb431 (patch) | |
| tree | 00359cabd37ad22e8228a5cc47a8600f45b74896 /src/include/nodes | |
| parent | b9459c6adbf08abae7bbddb5c497476814823b7d (diff) | |
Implement CREATE/DROP OPERATOR CLASS. Work still remains: need more
documentation (xindex.sgml should be rewritten), need to teach pg_dump
about it, need to update contrib modules that currently build pg_opclass
entries by hand. Original patch by Bill Studenmund, grammar adjustments
and general update for 7.3 by Tom Lane.
Diffstat (limited to 'src/include/nodes')
| -rw-r--r-- | src/include/nodes/nodes.h | 5 | ||||
| -rw-r--r-- | src/include/nodes/parsenodes.h | 45 |
2 files changed, 48 insertions, 2 deletions
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 3583315a274..93a020a12e9 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: nodes.h,v 1.113 2002/07/18 23:11:32 petere Exp $ + * $Id: nodes.h,v 1.114 2002/07/29 22:14:11 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -201,6 +201,8 @@ typedef enum NodeTag T_CreateConversionStmt, T_CreateCastStmt, T_DropCastStmt, + T_CreateOpClassStmt, + T_RemoveOpClassStmt, T_A_Expr = 700, T_ColumnRef, @@ -235,6 +237,7 @@ typedef enum NodeTag T_FuncWithArgs, T_PrivTarget, T_InsertDefault, + T_CreateOpClassItem, /* * TAGS FOR FUNCTION-CALL CONTEXT AND RESULTINFO NODES (see fmgr.h) diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 842a0b93d79..708e6ca19a5 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parsenodes.h,v 1.194 2002/07/24 19:11:14 petere Exp $ + * $Id: parsenodes.h,v 1.195 2002/07/29 22:14:11 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1116,6 +1116,37 @@ typedef struct CreateDomainStmt } CreateDomainStmt; /* ---------------------- + * Create Operator Class Statement + * ---------------------- + */ +typedef struct CreateOpClassStmt +{ + NodeTag type; + List *opclassname; /* qualified name (list of Value strings) */ + char *amname; /* name of index AM opclass is for */ + TypeName *datatype; /* datatype of indexed column */ + List *items; /* List of CreateOpClassItem nodes */ + bool isDefault; /* Should be marked as default for type? */ +} CreateOpClassStmt; + +#define OPCLASS_ITEM_OPERATOR 1 +#define OPCLASS_ITEM_FUNCTION 2 +#define OPCLASS_ITEM_STORAGETYPE 3 + +typedef struct CreateOpClassItem +{ + NodeTag type; + int itemtype; /* see codes above */ + /* fields used for an operator or function item: */ + List *name; /* operator or function name */ + List *args; /* argument types */ + int number; /* strategy num or support proc num */ + bool recheck; /* only used for operators */ + /* fields used for a storagetype item: */ + TypeName *storedtype; /* datatype stored in index */ +} CreateOpClassItem; + +/* ---------------------- * Drop Table|Sequence|View|Index|Type|Domain|Conversion|Schema Statement * ---------------------- */ @@ -1289,6 +1320,18 @@ typedef struct RemoveOperStmt } RemoveOperStmt; /* ---------------------- + * Drop Operator Class Statement + * ---------------------- + */ +typedef struct RemoveOpClassStmt +{ + NodeTag type; + List *opclassname; /* qualified name (list of Value strings) */ + char *amname; /* name of index AM opclass is for */ + DropBehavior behavior; /* RESTRICT or CASCADE behavior */ +} RemoveOpClassStmt; + +/* ---------------------- * Alter Object Rename Statement * ---------------------- * Currently supports renaming tables, table columns, and triggers. |
