aboutsummaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/nodes.h5
-rw-r--r--src/include/nodes/parsenodes.h33
2 files changed, 35 insertions, 3 deletions
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index 4e830d7527c..ffb7ca848fb 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodes.h,v 1.56 1999/11/23 20:07:02 momjian Exp $
+ * $Id: nodes.h,v 1.57 1999/12/06 18:02:46 wieck Exp $
*
*-------------------------------------------------------------------------
*/
@@ -215,7 +215,8 @@ typedef enum NodeTag
T_JoinExpr,
T_CaseExpr,
T_CaseWhen,
- T_RowMark
+ T_RowMark,
+ T_FkConstraint
} NodeTag;
/*
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 04c8c9b5182..542760a2357 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.87 1999/11/30 03:57:29 momjian Exp $
+ * $Id: parsenodes.h,v 1.88 1999/12/06 18:02:47 wieck Exp $
*
*-------------------------------------------------------------------------
*/
@@ -172,6 +172,37 @@ typedef struct Constraint
List *keys; /* list of primary keys */
} Constraint;
+
+/* ----------
+ * Definitions for FOREIGN KEY constraints in CreateStmt
+ * ----------
+ */
+#define FKCONSTR_ON_KEY_NOACTION 0x0000
+#define FKCONSTR_ON_KEY_RESTRICT 0x0001
+#define FKCONSTR_ON_KEY_CASCADE 0x0002
+#define FKCONSTR_ON_KEY_SETNULL 0x0004
+#define FKCONSTR_ON_KEY_SETDEFAULT 0x0008
+
+#define FKCONSTR_ON_DELETE_MASK 0x000F
+#define FKCONSTR_ON_DELETE_SHIFT 0
+
+#define FKCONSTR_ON_UPDATE_MASK 0x00F0
+#define FKCONSTR_ON_UPDATE_SHIFT 4
+
+typedef struct FkConstraint
+{
+ NodeTag type;
+ char *constr_name; /* Constraint name */
+ char *pktable_name; /* Primary key table name */
+ List *fk_attrs; /* Attributes of foreign key */
+ List *pk_attrs; /* Corresponding attrs in PK table */
+ char *match_type; /* FULL or PARTIAL */
+ int32 actions; /* ON DELETE/UPDATE actions */
+ bool deferrable; /* DEFERRABLE */
+ bool initdeferred; /* INITIALLY DEFERRED */
+} FkConstraint;
+
+
/* ----------------------
* Create/Drop TRIGGER Statements
* ----------------------