Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7b1c2a0

Browse files
committed
Split builtins.h to a new header ruleutils.h
The new header contains many prototypes for functions in ruleutils.c that are not exposed to the SQL level. Reviewed by Andres Freund and Michael Paquier.
1 parent 7bb0e97 commit 7b1c2a0

File tree

9 files changed

+41
-11
lines changed

9 files changed

+41
-11
lines changed

src/backend/access/index/genam.c

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "utils/builtins.h"
2929
#include "utils/lsyscache.h"
3030
#include "utils/rel.h"
31+
#include "utils/ruleutils.h"
3132
#include "utils/snapmgr.h"
3233
#include "utils/tqual.h"
3334

src/backend/catalog/heap.c

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
#include "utils/inval.h"
7070
#include "utils/lsyscache.h"
7171
#include "utils/rel.h"
72+
#include "utils/ruleutils.h"
7273
#include "utils/snapmgr.h"
7374
#include "utils/syscache.h"
7475
#include "utils/tqual.h"

src/backend/commands/explain.c

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "utils/json.h"
2929
#include "utils/lsyscache.h"
3030
#include "utils/rel.h"
31+
#include "utils/ruleutils.h"
3132
#include "utils/snapmgr.h"
3233
#include "utils/tuplesort.h"
3334
#include "utils/xml.h"

src/backend/commands/tablecmds.c

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
#include "utils/lsyscache.h"
8686
#include "utils/memutils.h"
8787
#include "utils/relcache.h"
88+
#include "utils/ruleutils.h"
8889
#include "utils/snapmgr.h"
8990
#include "utils/syscache.h"
9091
#include "utils/tqual.h"

src/backend/commands/typecmds.c

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
#include "utils/lsyscache.h"
7373
#include "utils/memutils.h"
7474
#include "utils/rel.h"
75+
#include "utils/ruleutils.h"
7576
#include "utils/snapmgr.h"
7677
#include "utils/syscache.h"
7778
#include "utils/tqual.h"

src/backend/utils/adt/misc.c

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "storage/proc.h"
3636
#include "storage/procarray.h"
3737
#include "utils/lsyscache.h"
38+
#include "utils/ruleutils.h"
3839
#include "tcop/tcopprot.h"
3940
#include "utils/builtins.h"
4041
#include "utils/timestamp.h"

src/backend/utils/adt/ruleutils.c

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include "utils/fmgroids.h"
5656
#include "utils/lsyscache.h"
5757
#include "utils/rel.h"
58+
#include "utils/ruleutils.h"
5859
#include "utils/snapmgr.h"
5960
#include "utils/syscache.h"
6061
#include "utils/tqual.h"

src/include/utils/builtins.h

-11
Original file line numberDiff line numberDiff line change
@@ -676,13 +676,10 @@ extern Datum pg_get_viewdef_name(PG_FUNCTION_ARGS);
676676
extern Datum pg_get_viewdef_name_ext(PG_FUNCTION_ARGS);
677677
extern Datum pg_get_indexdef(PG_FUNCTION_ARGS);
678678
extern Datum pg_get_indexdef_ext(PG_FUNCTION_ARGS);
679-
extern char *pg_get_indexdef_string(Oid indexrelid);
680-
extern char *pg_get_indexdef_columns(Oid indexrelid, bool pretty);
681679
extern Datum pg_get_triggerdef(PG_FUNCTION_ARGS);
682680
extern Datum pg_get_triggerdef_ext(PG_FUNCTION_ARGS);
683681
extern Datum pg_get_constraintdef(PG_FUNCTION_ARGS);
684682
extern Datum pg_get_constraintdef_ext(PG_FUNCTION_ARGS);
685-
extern char *pg_get_constraintdef_string(Oid constraintId);
686683
extern Datum pg_get_expr(PG_FUNCTION_ARGS);
687684
extern Datum pg_get_expr_ext(PG_FUNCTION_ARGS);
688685
extern Datum pg_get_userbyid(PG_FUNCTION_ARGS);
@@ -692,17 +689,9 @@ extern Datum pg_get_function_arguments(PG_FUNCTION_ARGS);
692689
extern Datum pg_get_function_identity_arguments(PG_FUNCTION_ARGS);
693690
extern Datum pg_get_function_result(PG_FUNCTION_ARGS);
694691
extern Datum pg_get_function_arg_default(PG_FUNCTION_ARGS);
695-
extern char *deparse_expression(Node *expr, List *dpcontext,
696-
bool forceprefix, bool showimplicit);
697-
extern List *deparse_context_for(const char *aliasname, Oid relid);
698-
extern List *deparse_context_for_planstate(Node *planstate, List *ancestors,
699-
List *rtable, List *rtable_names);
700-
extern List *select_rtable_names_for_explain(List *rtable,
701-
Bitmapset *rels_used);
702692
extern const char *quote_identifier(const char *ident);
703693
extern char *quote_qualified_identifier(const char *qualifier,
704694
const char *ident);
705-
extern char *generate_collation_name(Oid collid);
706695

707696

708697
/* tid.c */

src/include/utils/ruleutils.h

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* ruleutils.h
4+
* Declarations for ruleutils.c
5+
*
6+
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
7+
* Portions Copyright (c) 1994, Regents of the University of California
8+
*
9+
* src/include/ruleutils.h
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndef RULEUTILS_H
14+
#define RULEUTILS_H
15+
16+
#include "nodes/nodes.h"
17+
#include "nodes/parsenodes.h"
18+
#include "nodes/pg_list.h"
19+
20+
21+
extern char *pg_get_indexdef_string(Oid indexrelid);
22+
extern char *pg_get_indexdef_columns(Oid indexrelid, bool pretty);
23+
24+
extern char *pg_get_constraintdef_string(Oid constraintId);
25+
extern char *deparse_expression(Node *expr, List *dpcontext,
26+
bool forceprefix, bool showimplicit);
27+
extern List *deparse_context_for(const char *aliasname, Oid relid);
28+
extern List *deparse_context_for_planstate(Node *planstate, List *ancestors,
29+
List *rtable, List *rtable_names);
30+
extern List *select_rtable_names_for_explain(List *rtable,
31+
Bitmapset *rels_used);
32+
extern char *generate_collation_name(Oid collid);
33+
34+
#endif /* RULEUTILS_H */

0 commit comments

Comments
 (0)