aboutsummaryrefslogtreecommitdiff
path: root/src/include/nodes/primnodes.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2024-10-17 08:36:14 +0200
committerPeter Eisentraut <peter@eisentraut.org>2024-10-17 08:36:48 +0200
commiteafda78fc404c706da4cfa254dafb3e97f6cd111 (patch)
treef02f446596af7647af6f840011671fa5ef8f2cb3 /src/include/nodes/primnodes.h
parent41b023946dfd20acbc4f3b14650a032eb46f5216 (diff)
downloadpostgresql-eafda78fc404c706da4cfa254dafb3e97f6cd111.tar.gz
postgresql-eafda78fc404c706da4cfa254dafb3e97f6cd111.zip
Improve node type forward reference
Instead of using Node *, we can use an incomplete struct. That way, everything has the correct type and fewer casts are required. This technique is already used elsewhere in node type definitions. Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Tender Wang <tndrwang@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/637eeea8-5663-460b-a114-39572c0f6c6e%40eisentraut.org
Diffstat (limited to 'src/include/nodes/primnodes.h')
-rw-r--r--src/include/nodes/primnodes.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index ea47652adb8..5b7b87dea54 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -152,8 +152,8 @@ typedef struct TableFunc
* For CREATE MATERIALIZED VIEW, viewQuery is the parsed-but-not-rewritten
* SELECT Query for the view; otherwise it's NULL. This is irrelevant in
* the query jumbling as CreateTableAsStmt already includes a reference to
- * its own Query, so ignore it. (Although it's actually Query*, we declare
- * it as Node* to avoid a forward reference.)
+ * its own Query, so ignore it. (We declare it as struct Query* to avoid a
+ * forward reference.)
*/
typedef struct IntoClause
{
@@ -166,7 +166,7 @@ typedef struct IntoClause
OnCommitAction onCommit; /* what do we do at COMMIT? */
char *tableSpaceName; /* table space to use, or NULL */
/* materialized view's SELECT query */
- Node *viewQuery pg_node_attr(query_jumble_ignore);
+ struct Query *viewQuery pg_node_attr(query_jumble_ignore);
bool skipData; /* true for WITH NO DATA */
} IntoClause;