Stop including parsenodes.h in plannodes.h
authorAlvaro Herrera <[email protected]>
Tue, 7 Nov 2023 18:26:39 +0000 (19:26 +0100)
committerAlvaro Herrera <[email protected]>
Tue, 7 Nov 2023 18:26:39 +0000 (19:26 +0100)
I added it by mistake in commit 7103ebb7aae8.  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 dac048f71ebb, 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 <[email protected]>
Discussion: https://postgr.es/m/202311071106[email protected]

src/backend/utils/adt/windowfuncs.c
src/include/bootstrap/bootstrap.h
src/include/nodes/parsenodes.h
src/include/nodes/plannodes.h
src/include/nodes/primnodes.h
src/include/tcop/tcopprot.h

index b87a624fb2fc56762d66f4b9889de22fb97a3444..0bfbac00d7bab27ee037279d6ebe9d4dd914b9b1 100644 (file)
@@ -13,6 +13,7 @@
  */
 #include "postgres.h"
 
+#include "nodes/parsenodes.h"
 #include "nodes/supportnodes.h"
 #include "utils/builtins.h"
 #include "windowapi.h"
index e1cb73c5f2e46f6a9ce350717da115cac96fed9f..6a212122a31aa08aecb006d7fb7d7c2a59e39eb9 100644 (file)
@@ -15,6 +15,7 @@
 #define BOOTSTRAP_H
 
 #include "nodes/execnodes.h"
+#include "nodes/parsenodes.h"
 
 
 /*
index cf7e79062ed823875416f34dff0c35e175bf3d1f..e494309da8d596b3ee2eae04c232928614d3679f 100644 (file)
 #include "partitioning/partdefs.h"
 
 
-typedef enum OverridingKind
-{
-       OVERRIDING_NOT_SET = 0,
-       OVERRIDING_USER_VALUE,
-       OVERRIDING_SYSTEM_VALUE,
-} OverridingKind;
-
 /* Possible sources of a Query */
 typedef enum QuerySource
 {
@@ -1681,23 +1674,6 @@ typedef struct MergeWhenClause
        List       *values;                     /* VALUES to INSERT, or NULL */
 } MergeWhenClause;
 
-/*
- * MergeAction -
- *             Transformed representation of a WHEN clause in a MERGE statement
- */
-typedef struct MergeAction
-{
-       NodeTag         type;
-       bool            matched;                /* true=MATCHED, false=NOT MATCHED */
-       CmdType         commandType;    /* INSERT/UPDATE/DELETE/DO NOTHING */
-       /* OVERRIDING clause */
-       OverridingKind override pg_node_attr(query_jumble_ignore);
-       Node       *qual;                       /* transformed WHEN conditions */
-       List       *targetList;         /* the target list (of TargetEntry) */
-       /* target attribute numbers of an UPDATE */
-       List       *updateColnos pg_node_attr(query_jumble_ignore);
-} MergeAction;
-
 /*
  * TriggerTransition -
  *        representation of transition row or table naming clause
index 24d46c76dc262ae68030285edbc7ea3604eb41df..d40af8e59fede668df4c9fc7358e982acf409567 100644 (file)
@@ -20,7 +20,6 @@
 #include "lib/stringinfo.h"
 #include "nodes/bitmapset.h"
 #include "nodes/lockoptions.h"
-#include "nodes/parsenodes.h"
 #include "nodes/primnodes.h"
 
 
index ab6d7fdc6dfe907a6aa2ceebd0fdb3201f5fa5ed..bb930afb5216487ff3c9bad4d9c094613a05a57b 100644 (file)
 #include "nodes/pg_list.h"
 
 
+typedef enum OverridingKind
+{
+       OVERRIDING_NOT_SET = 0,
+       OVERRIDING_USER_VALUE,
+       OVERRIDING_SYSTEM_VALUE,
+} OverridingKind;
+
+
 /* ----------------------------------------------------------------
  *                                             node definitions
  * ----------------------------------------------------------------
@@ -1718,6 +1726,25 @@ typedef struct BooleanTest
        int                     location;               /* token location, or -1 if unknown */
 } BooleanTest;
 
+
+/*
+ * MergeAction
+ *
+ * Transformed representation of a WHEN clause in a MERGE statement
+ */
+typedef struct MergeAction
+{
+       NodeTag         type;
+       bool            matched;                /* true=MATCHED, false=NOT MATCHED */
+       CmdType         commandType;    /* INSERT/UPDATE/DELETE/DO NOTHING */
+       /* OVERRIDING clause */
+       OverridingKind override pg_node_attr(query_jumble_ignore);
+       Node       *qual;                       /* transformed WHEN conditions */
+       List       *targetList;         /* the target list (of TargetEntry) */
+       /* target attribute numbers of an UPDATE */
+       List       *updateColnos pg_node_attr(query_jumble_ignore);
+} MergeAction;
+
 /*
  * CoerceToDomain
  *
index 6c49db3bb7f1b7b5bb90cda9ce77bb8eca384177..b694d85974a424ec32501b526d32f19d40c82ee7 100644 (file)
@@ -15,7 +15,6 @@
 #define TCOPPROT_H
 
 #include "nodes/params.h"
-#include "nodes/parsenodes.h"
 #include "nodes/plannodes.h"
 #include "storage/procsignal.h"
 #include "utils/guc.h"