PostgreSQL Source Code  git master
rewriteDefine.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * rewriteDefine.h
4  *
5  *
6  *
7  * Portions Copyright (c) 1996-2024, 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(const 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 */
#define stmt
Definition: indent_codes.h:59
CmdType
Definition: nodes.h:263
unsigned int Oid
Definition: postgres_ext.h:31
void setRuleCheckAsUser(Node *node, Oid userid)
ObjectAddress DefineRule(RuleStmt *stmt, const char *queryString)
ObjectAddress DefineQueryRewrite(const 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)
ObjectAddress RenameRewriteRule(RangeVar *relation, const char *oldName, const char *newName)
Definition: pg_list.h:54
Definition: nodes.h:129