Skip to content

Commit fa2cf16

Browse files
committed
Rename nodes/relation.h to nodes/pathnodes.h.
The old name of this file was never a very good indication of what it was for. Now that there's also access/relation.h, we have a potential confusion hazard as well, so let's rename it to something more apropos. Per discussion, "pathnodes.h" is reasonable, since a good fraction of the file is Path node definitions. While at it, tweak a couple of other headers that were gratuitously importing relation.h into modules that don't need it. Discussion: https://postgr.es/m/7719.1548688728@sss.pgh.pa.us
1 parent f09346a commit fa2cf16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+60
-59
lines changed

contrib/bloom/bloom.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "access/generic_xlog.h"
1818
#include "access/itup.h"
1919
#include "access/xlog.h"
20-
#include "nodes/relation.h"
20+
#include "nodes/pathnodes.h"
2121
#include "fmgr.h"
2222

2323
/* Support procedures numbers */

contrib/postgres_fdw/postgres_fdw.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include "foreign/foreign.h"
1717
#include "lib/stringinfo.h"
18-
#include "nodes/relation.h"
18+
#include "nodes/pathnodes.h"
1919
#include "utils/relcache.h"
2020

2121
#include "libpq-fe.h"

src/backend/executor/execAmi.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656
#include "executor/nodeValuesscan.h"
5757
#include "executor/nodeWindowAgg.h"
5858
#include "executor/nodeWorktablescan.h"
59+
#include "nodes/extensible.h"
5960
#include "nodes/nodeFuncs.h"
60-
#include "nodes/relation.h"
61+
#include "nodes/pathnodes.h"
6162
#include "utils/rel.h"
6263
#include "utils/syscache.h"
6364

src/backend/executor/nodeCustom.c

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "executor/executor.h"
1515
#include "executor/nodeCustom.h"
1616
#include "nodes/execnodes.h"
17+
#include "nodes/extensible.h"
1718
#include "nodes/plannodes.h"
1819
#include "miscadmin.h"
1920
#include "parser/parsetree.h"

src/backend/nodes/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ FILES IN src/include/nodes/
3636
nodes.h - define node tags (NodeTag)
3737
primnodes.h - primitive nodes
3838
parsenodes.h - parse tree nodes
39+
pathnodes.h - path tree nodes and planner internal structures
3940
plannodes.h - plan tree nodes
40-
relation.h - planner internal nodes
4141
execnodes.h - executor nodes
4242
memnodes.h - memory nodes
4343
pg_list.h - generic list

src/backend/nodes/copyfuncs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
#include "miscadmin.h"
2626
#include "nodes/extensible.h"
27+
#include "nodes/pathnodes.h"
2728
#include "nodes/plannodes.h"
28-
#include "nodes/relation.h"
2929
#include "utils/datum.h"
3030
#include "utils/rel.h"
3131

@@ -2196,7 +2196,7 @@ _copyOnConflictExpr(const OnConflictExpr *from)
21962196
}
21972197

21982198
/* ****************************************************************
2199-
* relation.h copy functions
2199+
* pathnodes.h copy functions
22002200
*
22012201
* We don't support copying RelOptInfo, IndexOptInfo, or Path nodes.
22022202
* There are some subsidiary structs that are useful to copy, though.

src/backend/nodes/equalfuncs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#include "miscadmin.h"
3333
#include "nodes/extensible.h"
34-
#include "nodes/relation.h"
34+
#include "nodes/pathnodes.h"
3535
#include "utils/datum.h"
3636

3737

@@ -814,7 +814,7 @@ _equalOnConflictExpr(const OnConflictExpr *a, const OnConflictExpr *b)
814814
}
815815

816816
/*
817-
* Stuff from relation.h
817+
* Stuff from pathnodes.h
818818
*/
819819

820820
static bool

src/backend/nodes/nodeFuncs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "nodes/makefuncs.h"
2121
#include "nodes/execnodes.h"
2222
#include "nodes/nodeFuncs.h"
23-
#include "nodes/relation.h"
23+
#include "nodes/pathnodes.h"
2424
#include "utils/builtins.h"
2525
#include "utils/lsyscache.h"
2626

src/backend/nodes/outfuncs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#include "lib/stringinfo.h"
3333
#include "miscadmin.h"
3434
#include "nodes/extensible.h"
35+
#include "nodes/pathnodes.h"
3536
#include "nodes/plannodes.h"
36-
#include "nodes/relation.h"
3737
#include "utils/datum.h"
3838
#include "utils/rel.h"
3939

@@ -1676,7 +1676,7 @@ _outOnConflictExpr(StringInfo str, const OnConflictExpr *node)
16761676

16771677
/*****************************************************************************
16781678
*
1679-
* Stuff from relation.h.
1679+
* Stuff from pathnodes.h.
16801680
*
16811681
*****************************************************************************/
16821682

src/backend/nodes/print.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#include "access/printtup.h"
2323
#include "lib/stringinfo.h"
2424
#include "nodes/nodeFuncs.h"
25+
#include "nodes/pathnodes.h"
2526
#include "nodes/print.h"
26-
#include "nodes/relation.h"
2727
#include "parser/parsetree.h"
2828
#include "utils/lsyscache.h"
2929

src/backend/optimizer/path/costsize.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ cost_index(IndexPath *path, PlannerInfo *root, double loop_count,
540540
* for scanning the index, as well as the selectivity of the index (ie,
541541
* the fraction of main-table tuples we will have to retrieve) and its
542542
* correlation to the main-table tuple order. We need a cast here because
543-
* relation.h uses a weak function type to avoid including amapi.h.
543+
* pathnodes.h uses a weak function type to avoid including amapi.h.
544544
*/
545545
amcostestimate = (amcostestimate_function) index->amcostestimate;
546546
amcostestimate(root, path, loop_count,
@@ -4072,7 +4072,7 @@ get_restriction_qual_cost(PlannerInfo *root, RelOptInfo *baserel,
40724072
* sjinfo: SpecialJoinInfo relevant to this join
40734073
* restrictlist: join quals
40744074
* Output parameters:
4075-
* *semifactors is filled in (see relation.h for field definitions)
4075+
* *semifactors is filled in (see pathnodes.h for field definitions)
40764076
*/
40774077
void
40784078
compute_semi_anti_join_factors(PlannerInfo *root,

src/backend/optimizer/util/predtest.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "miscadmin.h"
2222
#include "nodes/makefuncs.h"
2323
#include "nodes/nodeFuncs.h"
24-
#include "nodes/relation.h"
24+
#include "nodes/pathnodes.h"
2525
#include "optimizer/optimizer.h"
2626
#include "utils/array.h"
2727
#include "utils/inval.h"

src/backend/rewrite/rewriteManip.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include "catalog/pg_type.h"
1717
#include "nodes/makefuncs.h"
1818
#include "nodes/nodeFuncs.h"
19+
#include "nodes/pathnodes.h"
1920
#include "nodes/plannodes.h"
20-
#include "nodes/relation.h"
2121
#include "parser/parse_coerce.h"
2222
#include "parser/parse_relation.h"
2323
#include "parser/parsetree.h"

src/backend/statistics/dependencies.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "optimizer/clauses.h"
2323
#include "optimizer/optimizer.h"
2424
#include "nodes/nodes.h"
25-
#include "nodes/relation.h"
25+
#include "nodes/pathnodes.h"
2626
#include "statistics/extended_stats_internal.h"
2727
#include "statistics/statistics.h"
2828
#include "utils/bytea.h"

src/backend/statistics/extended_stats.c

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "catalog/indexing.h"
2323
#include "catalog/pg_collation.h"
2424
#include "catalog/pg_statistic_ext.h"
25-
#include "nodes/relation.h"
2625
#include "postmaster/autovacuum.h"
2726
#include "statistics/extended_stats_internal.h"
2827
#include "statistics/statistics.h"

src/include/access/tsmapi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define TSMAPI_H
1414

1515
#include "nodes/execnodes.h"
16-
#include "nodes/relation.h"
16+
#include "nodes/pathnodes.h"
1717

1818

1919
/*

src/include/executor/executor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ extern PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook;
8787
/*
8888
* prototypes from functions in execAmi.c
8989
*/
90-
struct Path; /* avoid including relation.h here */
90+
struct Path; /* avoid including pathnodes.h here */
9191

9292
extern void ExecReScan(PlanState *node);
9393
extern void ExecMarkPos(PlanState *node);

src/include/executor/nodeCustom.h

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#include "access/parallel.h"
1616
#include "nodes/execnodes.h"
17-
#include "nodes/extensible.h"
1817

1918
/*
2019
* General executor code

src/include/foreign/fdwapi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include "access/parallel.h"
1616
#include "nodes/execnodes.h"
17-
#include "nodes/relation.h"
17+
#include "nodes/pathnodes.h"
1818

1919
/* To avoid including explain.h here, reference ExplainState thus: */
2020
struct ExplainState;

src/include/nodes/extensible.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include "access/parallel.h"
1818
#include "commands/explain.h"
1919
#include "nodes/execnodes.h"
20+
#include "nodes/pathnodes.h"
2021
#include "nodes/plannodes.h"
21-
#include "nodes/relation.h"
2222

2323
/* maximum length of an extensible node identifier */
2424
#define EXTNODENAME_MAX_LEN 64

src/include/nodes/nodes.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ typedef enum NodeTag
215215
T_DomainConstraintState,
216216

217217
/*
218-
* TAGS FOR PLANNER NODES (relation.h)
218+
* TAGS FOR PLANNER NODES (pathnodes.h)
219219
*/
220220
T_PlannerInfo,
221221
T_PlannerGlobal,
@@ -741,7 +741,7 @@ typedef enum JoinType
741741
* AggStrategy -
742742
* overall execution strategies for Agg plan nodes
743743
*
744-
* This is needed in both plannodes.h and relation.h, so put it here...
744+
* This is needed in both pathnodes.h and plannodes.h, so put it here...
745745
*/
746746
typedef enum AggStrategy
747747
{
@@ -755,7 +755,7 @@ typedef enum AggStrategy
755755
* AggSplit -
756756
* splitting (partial aggregation) modes for Agg plan nodes
757757
*
758-
* This is needed in both plannodes.h and relation.h, so put it here...
758+
* This is needed in both pathnodes.h and plannodes.h, so put it here...
759759
*/
760760

761761
/* Primitive options supported by nodeAgg.c: */
@@ -785,7 +785,7 @@ typedef enum AggSplit
785785
* SetOpCmd and SetOpStrategy -
786786
* overall semantics and execution strategies for SetOp plan nodes
787787
*
788-
* This is needed in both plannodes.h and relation.h, so put it here...
788+
* This is needed in both pathnodes.h and plannodes.h, so put it here...
789789
*/
790790
typedef enum SetOpCmd
791791
{

src/include/nodes/relation.h renamed to src/include/nodes/pathnodes.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* relation.h
4-
* Definitions for planner's internal data structures.
3+
* pathnodes.h
4+
* Definitions for planner's internal data structures, especially Paths.
55
*
66
*
77
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* src/include/nodes/relation.h
10+
* src/include/nodes/pathnodes.h
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
14-
#ifndef RELATION_H
15-
#define RELATION_H
14+
#ifndef PATHNODES_H
15+
#define PATHNODES_H
1616

1717
#include "access/sdir.h"
1818
#include "fmgr.h"
@@ -2433,4 +2433,4 @@ typedef struct JoinCostWorkspace
24332433
double inner_rows_total;
24342434
} JoinCostWorkspace;
24352435

2436-
#endif /* RELATION_H */
2436+
#endif /* PATHNODES_H */

src/include/optimizer/appendinfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef APPENDINFO_H
1515
#define APPENDINFO_H
1616

17-
#include "nodes/relation.h"
17+
#include "nodes/pathnodes.h"
1818
#include "utils/relcache.h"
1919

2020
extern AppendRelInfo *make_append_rel_info(Relation parentrel,

src/include/optimizer/clauses.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define CLAUSES_H
1616

1717
#include "access/htup.h"
18-
#include "nodes/relation.h"
18+
#include "nodes/pathnodes.h"
1919

2020
typedef struct
2121
{

src/include/optimizer/cost.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#ifndef COST_H
1515
#define COST_H
1616

17+
#include "nodes/pathnodes.h"
1718
#include "nodes/plannodes.h"
18-
#include "nodes/relation.h"
1919

2020

2121
/* defaults for costsize.c's Cost parameters */

src/include/optimizer/geqo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef GEQO_H
2323
#define GEQO_H
2424

25-
#include "nodes/relation.h"
25+
#include "nodes/pathnodes.h"
2626
#include "optimizer/geqo_gene.h"
2727

2828

src/include/optimizer/inherit.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef INHERIT_H
1515
#define INHERIT_H
1616

17-
#include "nodes/relation.h"
17+
#include "nodes/pathnodes.h"
1818

1919

2020
extern void expand_inherited_tables(PlannerInfo *root);

src/include/optimizer/joininfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef JOININFO_H
1515
#define JOININFO_H
1616

17-
#include "nodes/relation.h"
17+
#include "nodes/pathnodes.h"
1818

1919

2020
extern bool have_relevant_joinclause(PlannerInfo *root,

src/include/optimizer/optimizer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
#include "nodes/parsenodes.h"
2626

2727
/*
28-
* We don't want to include nodes/relation.h here, because non-planner
28+
* We don't want to include nodes/pathnodes.h here, because non-planner
2929
* code should generally treat PlannerInfo as an opaque typedef.
3030
* But we'd like such code to use that typedef name, so define the
31-
* typedef either here or in relation.h, whichever is read first.
31+
* typedef either here or in pathnodes.h, whichever is read first.
3232
*/
3333
#ifndef HAVE_PLANNERINFO_TYPEDEF
3434
typedef struct PlannerInfo PlannerInfo;

src/include/optimizer/orclauses.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef ORCLAUSES_H
1515
#define ORCLAUSES_H
1616

17-
#include "nodes/relation.h"
17+
#include "nodes/pathnodes.h"
1818

1919
extern void extract_restriction_or_clauses(PlannerInfo *root);
2020

src/include/optimizer/paramassign.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef PARAMASSIGN_H
1414
#define PARAMASSIGN_H
1515

16-
#include "nodes/relation.h"
16+
#include "nodes/pathnodes.h"
1717

1818
extern Param *replace_outer_var(PlannerInfo *root, Var *var);
1919
extern Param *replace_outer_placeholdervar(PlannerInfo *root,

src/include/optimizer/pathnode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define PATHNODE_H
1616

1717
#include "nodes/bitmapset.h"
18-
#include "nodes/relation.h"
18+
#include "nodes/pathnodes.h"
1919

2020

2121
/*

src/include/optimizer/paths.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef PATHS_H
1515
#define PATHS_H
1616

17-
#include "nodes/relation.h"
17+
#include "nodes/pathnodes.h"
1818

1919

2020
/*

src/include/optimizer/placeholder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef PLACEHOLDER_H
1515
#define PLACEHOLDER_H
1616

17-
#include "nodes/relation.h"
17+
#include "nodes/pathnodes.h"
1818

1919

2020
extern PlaceHolderVar *make_placeholder_expr(PlannerInfo *root, Expr *expr,

0 commit comments

Comments
 (0)