1/*-------------------------------------------------------------------------
2 *
3 * rewriteHandler.h
4 * External interface to query rewriter.
5 *
6 *
7 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/rewrite/rewriteHandler.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#ifndef REWRITEHANDLER_H
15#define REWRITEHANDLER_H
16
17#include "utils/relcache.h"
18#include "nodes/parsenodes.h"
19
20extern List *QueryRewrite(Query *parsetree);
21extern void AcquireRewriteLocks(Query *parsetree,
22 bool forExecute,
23 bool forUpdatePushedDown);
24
25extern Node *build_column_default(Relation rel, int attrno);
26extern void rewriteTargetListUD(Query *parsetree, RangeTblEntry *target_rte,
27 Relation target_relation);
28
29extern Query *get_view_query(Relation view);
30extern const char *view_query_is_auto_updatable(Query *viewquery,
31 bool check_cols);
32extern int relation_is_updatable(Oid reloid,
33 bool include_triggers,
34 Bitmapset *include_cols);
35
36#endif /* REWRITEHANDLER_H */
37