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

Commit 615f5f6

Browse files
committed
Stop including parsenodes.h in plannodes.h
I added it by mistake in commit 7103ebb. To clean up, struct MergeAction needs to be moved to primnodes.h from parsenodes.h. (This forces us to also move OverridingKind to primnodes.h). Having to add parsenodes.h to bootstrap.h as fallout is a bit surprising, since nothing nominally needs it there. However, per comments in bootscanner.l, it is needed so that YYSTYPE can be declared. I think this only started with commit dac048f, but I didn't actually verify that. In passing, stop including parsenodes.h in tcopprot.h. Nothing needs it there. Per discussion on a patch by Ashutosh Bapat. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/202311071106.6y7b2ascqjlz@alvherre.pgsql
1 parent 3c551eb commit 615f5f6

File tree

6 files changed

+29
-26
lines changed

6 files changed

+29
-26
lines changed

src/backend/utils/adt/windowfuncs.c

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
#include "postgres.h"
1515

16+
#include "nodes/parsenodes.h"
1617
#include "nodes/supportnodes.h"
1718
#include "utils/builtins.h"
1819
#include "windowapi.h"

src/include/bootstrap/bootstrap.h

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

1717
#include "nodes/execnodes.h"
18+
#include "nodes/parsenodes.h"
1819

1920

2021
/*

src/include/nodes/parsenodes.h

-24
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030
#include "partitioning/partdefs.h"
3131

3232

33-
typedef enum OverridingKind
34-
{
35-
OVERRIDING_NOT_SET = 0,
36-
OVERRIDING_USER_VALUE,
37-
OVERRIDING_SYSTEM_VALUE,
38-
} OverridingKind;
39-
4033
/* Possible sources of a Query */
4134
typedef enum QuerySource
4235
{
@@ -1681,23 +1674,6 @@ typedef struct MergeWhenClause
16811674
List *values; /* VALUES to INSERT, or NULL */
16821675
} MergeWhenClause;
16831676

1684-
/*
1685-
* MergeAction -
1686-
* Transformed representation of a WHEN clause in a MERGE statement
1687-
*/
1688-
typedef struct MergeAction
1689-
{
1690-
NodeTag type;
1691-
bool matched; /* true=MATCHED, false=NOT MATCHED */
1692-
CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
1693-
/* OVERRIDING clause */
1694-
OverridingKind override pg_node_attr(query_jumble_ignore);
1695-
Node *qual; /* transformed WHEN conditions */
1696-
List *targetList; /* the target list (of TargetEntry) */
1697-
/* target attribute numbers of an UPDATE */
1698-
List *updateColnos pg_node_attr(query_jumble_ignore);
1699-
} MergeAction;
1700-
17011677
/*
17021678
* TriggerTransition -
17031679
* representation of transition row or table naming clause

src/include/nodes/plannodes.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "lib/stringinfo.h"
2121
#include "nodes/bitmapset.h"
2222
#include "nodes/lockoptions.h"
23-
#include "nodes/parsenodes.h"
2423
#include "nodes/primnodes.h"
2524

2625

src/include/nodes/primnodes.h

+27
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
#include "nodes/pg_list.h"
2323

2424

25+
typedef enum OverridingKind
26+
{
27+
OVERRIDING_NOT_SET = 0,
28+
OVERRIDING_USER_VALUE,
29+
OVERRIDING_SYSTEM_VALUE,
30+
} OverridingKind;
31+
32+
2533
/* ----------------------------------------------------------------
2634
* node definitions
2735
* ----------------------------------------------------------------
@@ -1718,6 +1726,25 @@ typedef struct BooleanTest
17181726
int location; /* token location, or -1 if unknown */
17191727
} BooleanTest;
17201728

1729+
1730+
/*
1731+
* MergeAction
1732+
*
1733+
* Transformed representation of a WHEN clause in a MERGE statement
1734+
*/
1735+
typedef struct MergeAction
1736+
{
1737+
NodeTag type;
1738+
bool matched; /* true=MATCHED, false=NOT MATCHED */
1739+
CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
1740+
/* OVERRIDING clause */
1741+
OverridingKind override pg_node_attr(query_jumble_ignore);
1742+
Node *qual; /* transformed WHEN conditions */
1743+
List *targetList; /* the target list (of TargetEntry) */
1744+
/* target attribute numbers of an UPDATE */
1745+
List *updateColnos pg_node_attr(query_jumble_ignore);
1746+
} MergeAction;
1747+
17211748
/*
17221749
* CoerceToDomain
17231750
*

src/include/tcop/tcopprot.h

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

1717
#include "nodes/params.h"
18-
#include "nodes/parsenodes.h"
1918
#include "nodes/plannodes.h"
2019
#include "storage/procsignal.h"
2120
#include "utils/guc.h"

0 commit comments

Comments
 (0)