Header And Logo

PostgreSQL
| The world's most advanced open source database.

rewriteDefine.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * rewriteDefine.h
00004  *
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/rewrite/rewriteDefine.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef REWRITEDEFINE_H
00015 #define REWRITEDEFINE_H
00016 
00017 #include "nodes/parsenodes.h"
00018 #include "utils/relcache.h"
00019 
00020 #define RULE_FIRES_ON_ORIGIN    'O'
00021 #define RULE_FIRES_ALWAYS       'A'
00022 #define RULE_FIRES_ON_REPLICA   'R'
00023 #define RULE_DISABLED           'D'
00024 
00025 extern Oid DefineRule(RuleStmt *stmt, const char *queryString);
00026 
00027 extern Oid DefineQueryRewrite(char *rulename,
00028                    Oid event_relid,
00029                    Node *event_qual,
00030                    CmdType event_type,
00031                    bool is_instead,
00032                    bool replace,
00033                    List *action);
00034 
00035 extern Oid RenameRewriteRule(RangeVar *relation, const char *oldName,
00036                   const char *newName);
00037 
00038 extern void setRuleCheckAsUser(Node *node, Oid userid);
00039 
00040 extern void EnableDisableRule(Relation rel, const char *rulename,
00041                   char fires_when);
00042 
00043 #endif   /* REWRITEDEFINE_H */