diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/pg_rewrite.h | 18 | ||||
-rw-r--r-- | src/include/rewrite/prs2lock.h | 3 | ||||
-rw-r--r-- | src/include/rewrite/rewriteDefine.h | 3 | ||||
-rw-r--r-- | src/include/rewrite/rewriteRemove.h | 3 | ||||
-rw-r--r-- | src/include/rewrite/viewUpdate.h | 21 |
5 files changed, 41 insertions, 7 deletions
diff --git a/src/include/catalog/pg_rewrite.h b/src/include/catalog/pg_rewrite.h index 313ce32731a..2dc621e5fee 100644 --- a/src/include/catalog/pg_rewrite.h +++ b/src/include/catalog/pg_rewrite.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_rewrite.h,v 1.31 2009/01/01 17:23:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_rewrite.h,v 1.32 2009/01/22 17:27:54 petere Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -40,6 +40,15 @@ CATALOG(pg_rewrite,2618) char ev_enabled; bool is_instead; + /* + * is_auto: True if the rule was automatically generated (update + * rules). This is tracked separately from the dependency system, + * because we want to allow overwriting the automatic update + * rules. So both automatically and manually generated rules have + * dependency type AUTO. + */ + bool is_auto; + /* NB: remaining fields must be accessed via heap_getattr */ text ev_qual; text ev_action; @@ -56,14 +65,15 @@ typedef FormData_pg_rewrite *Form_pg_rewrite; * compiler constants for pg_rewrite * ---------------- */ -#define Natts_pg_rewrite 8 +#define Natts_pg_rewrite 9 #define Anum_pg_rewrite_rulename 1 #define Anum_pg_rewrite_ev_class 2 #define Anum_pg_rewrite_ev_attr 3 #define Anum_pg_rewrite_ev_type 4 #define Anum_pg_rewrite_ev_enabled 5 #define Anum_pg_rewrite_is_instead 6 -#define Anum_pg_rewrite_ev_qual 7 -#define Anum_pg_rewrite_ev_action 8 +#define Anum_pg_rewrite_is_auto 7 +#define Anum_pg_rewrite_ev_qual 8 +#define Anum_pg_rewrite_ev_action 9 #endif /* PG_REWRITE_H */ diff --git a/src/include/rewrite/prs2lock.h b/src/include/rewrite/prs2lock.h index 1e47cb696b7..5d039c21c0d 100644 --- a/src/include/rewrite/prs2lock.h +++ b/src/include/rewrite/prs2lock.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/rewrite/prs2lock.h,v 1.25 2009/01/01 17:24:01 momjian Exp $ + * $PostgreSQL: pgsql/src/include/rewrite/prs2lock.h,v 1.26 2009/01/22 17:27:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -30,6 +30,7 @@ typedef struct RewriteRule List *actions; char enabled; bool isInstead; + bool is_auto; } RewriteRule; /* diff --git a/src/include/rewrite/rewriteDefine.h b/src/include/rewrite/rewriteDefine.h index 22e6267f4c0..10936fab848 100644 --- a/src/include/rewrite/rewriteDefine.h +++ b/src/include/rewrite/rewriteDefine.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/rewrite/rewriteDefine.h,v 1.31 2009/01/01 17:24:01 momjian Exp $ + * $PostgreSQL: pgsql/src/include/rewrite/rewriteDefine.h,v 1.32 2009/01/22 17:27:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -29,6 +29,7 @@ extern void DefineQueryRewrite(char *rulename, Node *event_qual, CmdType event_type, bool is_instead, + bool is_auto, bool replace, List *action); diff --git a/src/include/rewrite/rewriteRemove.h b/src/include/rewrite/rewriteRemove.h index d90c780b9f1..f7d3c354657 100644 --- a/src/include/rewrite/rewriteRemove.h +++ b/src/include/rewrite/rewriteRemove.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/rewrite/rewriteRemove.h,v 1.25 2009/01/01 17:24:01 momjian Exp $ + * $PostgreSQL: pgsql/src/include/rewrite/rewriteRemove.h,v 1.26 2009/01/22 17:27:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -20,5 +20,6 @@ extern void RemoveRewriteRule(Oid owningRel, const char *ruleName, DropBehavior behavior, bool missing_ok); extern void RemoveRewriteRuleById(Oid ruleOid); +extern void RemoveAutomaticRulesOnEvent(Relation rel, CmdType event_type); #endif /* REWRITEREMOVE_H */ diff --git a/src/include/rewrite/viewUpdate.h b/src/include/rewrite/viewUpdate.h new file mode 100644 index 00000000000..14238708462 --- /dev/null +++ b/src/include/rewrite/viewUpdate.h @@ -0,0 +1,21 @@ + +/*------------------------------------------------------------------------- + * + * viewUpdate.h + * + * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * $PostgreSQL: pgsql/src/include/rewrite/viewUpdate.h,v 1.1 2009/01/22 17:27:55 petere Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef VIEW_UPDATE_H +#define VIEW_UPDATE_H + +#include "nodes/parsenodes.h" + +extern void +CreateViewUpdateRules(Oid viewOid, const Query *viewDef); + +#endif /* VIEW_UPDATE_H */ |