!433 增加约束对象的ENABLE/DISABLE功能

Merge pull request !433 from liyongjin/Baranch_master_req1
This commit is contained in:
opengauss-bot
2020-12-28 20:17:16 +08:00
committed by Gitee
10 changed files with 279 additions and 24 deletions

View File

@ -95,6 +95,7 @@ CATALOG(pg_constraint,2606) BKI_SCHEMA_MACRO
bool consoft; /* @hdfs show informational constraint. */
bool conopt; /* @hdfs decide whether to optimize plan by using informational constraint. */
bool conisenable; /* enable = 1, disable = 0*/
#ifdef CATALOG_VARLEN /* variable-length fields start here */
@ -162,7 +163,7 @@ typedef FormData_pg_constraint *Form_pg_constraint;
* compiler constants for pg_constraint
* ----------------
*/
#define Natts_pg_constraint 27
#define Natts_pg_constraint 28
#define Anum_pg_constraint_conname 1
#define Anum_pg_constraint_connamespace 2
#define Anum_pg_constraint_contype 3
@ -181,15 +182,16 @@ typedef FormData_pg_constraint *Form_pg_constraint;
#define Anum_pg_constraint_connoinherit 16
#define Anum_pg_constraint_consoft 17
#define Anum_pg_constraint_conopt 18
#define Anum_pg_constraint_conkey 19
#define Anum_pg_constraint_confkey 20
#define Anum_pg_constraint_conpfeqop 21
#define Anum_pg_constraint_conppeqop 22
#define Anum_pg_constraint_conffeqop 23
#define Anum_pg_constraint_conexclop 24
#define Anum_pg_constraint_conbin 25
#define Anum_pg_constraint_consrc 26
#define Anum_pg_constraint_conincluding 27
#define Anum_pg_constraint_conisenable 19
#define Anum_pg_constraint_conkey 20
#define Anum_pg_constraint_confkey 21
#define Anum_pg_constraint_conpfeqop 22
#define Anum_pg_constraint_conppeqop 23
#define Anum_pg_constraint_conffeqop 24
#define Anum_pg_constraint_conexclop 25
#define Anum_pg_constraint_conbin 26
#define Anum_pg_constraint_consrc 27
#define Anum_pg_constraint_conincluding 28
/* Valid values for contype */

View File

@ -1567,6 +1567,8 @@ typedef enum AlterTableType {
AT_ExchangePartition, /* ALTER TABLE EXCHANGE PARTITION WITH TABLE */
AT_MergePartition, /*MERGE PARTITION */
AT_SplitPartition, /* SPLIT PARTITION */
AT_EnableConstraint, /* ENABLE CONSTRAINT name*/
AT_DisableConstraint, /* DISABLE CONSTRAINT name */
/* this will be in a more natural position in 9.3: */
AT_ReAddConstraint /* internal to commands/tablecmds.c */
} AlterTableType;

View File

@ -38,6 +38,7 @@ typedef struct Trigger {
char** tgargs;
char* tgqual;
Oid tgowner;
HeapTuple tuple;
} Trigger;
typedef struct TriggerDesc {