PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
rewriteDefine.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * rewriteDefine.h
4  *
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/rewrite/rewriteDefine.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef REWRITEDEFINE_H
15 #define REWRITEDEFINE_H
16 
17 #include "catalog/objectaddress.h"
18 #include "nodes/parsenodes.h"
19 #include "utils/relcache.h"
20 
21 #define RULE_FIRES_ON_ORIGIN 'O'
22 #define RULE_FIRES_ALWAYS 'A'
23 #define RULE_FIRES_ON_REPLICA 'R'
24 #define RULE_DISABLED 'D'
25 
26 extern ObjectAddress DefineRule(RuleStmt *stmt, const char *queryString);
27 
28 extern ObjectAddress DefineQueryRewrite(char *rulename,
29  Oid event_relid,
30  Node *event_qual,
31  CmdType event_type,
32  bool is_instead,
33  bool replace,
34  List *action);
35 
36 extern ObjectAddress RenameRewriteRule(RangeVar *relation, const char *oldName,
37  const char *newName);
38 
39 extern void setRuleCheckAsUser(Node *node, Oid userid);
40 
41 extern void EnableDisableRule(Relation rel, const char *rulename,
42  char fires_when);
43 
44 #endif /* REWRITEDEFINE_H */
ObjectAddress DefineRule(RuleStmt *stmt, const char *queryString)
ObjectAddress RenameRewriteRule(RangeVar *relation, const char *oldName, const char *newName)
ObjectAddress DefineQueryRewrite(char *rulename, Oid event_relid, Node *event_qual, CmdType event_type, bool is_instead, bool replace, List *action)
void EnableDisableRule(Relation rel, const char *rulename, char fires_when)
Definition: nodes.h:509
unsigned int Oid
Definition: postgres_ext.h:31
void setRuleCheckAsUser(Node *node, Oid userid)
Definition: pg_list.h:45
CmdType
Definition: nodes.h:648