diff options
author | Peter Eisentraut | 2024-03-22 06:12:28 +0000 |
---|---|---|
committer | Peter Eisentraut | 2024-03-22 06:28:33 +0000 |
commit | b4080fa3dcf6c6359e542169e0e81a0662c53ba8 (patch) | |
tree | c6914dc70d21e6bf0ca595ff6c9d1d4305f0ea99 | |
parent | 367c989cd8405663bb9a35ec1aa4f79b673a55ff (diff) |
Make RangeTblEntry dump order consistent
Put the fields alias and eref earlier in the struct, so that it
matches the order in _outRangeTblEntry()/_readRangeTblEntry(). This
helps if we ever want to fully automate out/read of RangeTblEntry.
Also, it makes dumps in the debugger easier to read in the same way.
Internally, this makes no difference.
Reviewed-by: Andrew Dunstan <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/[email protected]
-rw-r--r-- | src/backend/nodes/outfuncs.c | 1 | ||||
-rw-r--r-- | src/backend/nodes/readfuncs.c | 1 | ||||
-rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
-rw-r--r-- | src/include/nodes/parsenodes.h | 14 |
4 files changed, 11 insertions, 7 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 29cbc83bd9f..c55375e7f91 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -494,7 +494,6 @@ _outRangeTblEntry(StringInfo str, const RangeTblEntry *node) { WRITE_NODE_TYPE("RANGETBLENTRY"); - /* put alias + eref first to make dump more legible */ WRITE_NODE_FIELD(alias); WRITE_NODE_FIELD(eref); WRITE_ENUM_FIELD(rtekind, RTEKind); diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index a122407c880..c4d01a441a0 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -348,7 +348,6 @@ _readRangeTblEntry(void) { READ_LOCALS(RangeTblEntry); - /* put alias + eref first to make dump more legible */ READ_NODE_FIELD(alias); READ_NODE_FIELD(eref); READ_ENUM_FIELD(rtekind, RTEKind); diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 3c4e49b73a0..a52bb137a9b 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -57,6 +57,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202403202 +#define CATALOG_VERSION_NO 202403221 #endif diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 1ea3b8f0b10..298a6828331 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1027,6 +1027,16 @@ typedef struct RangeTblEntry NodeTag type; + /* + * Fields valid in all RTEs: + * + * put alias + eref first to make dump more legible + */ + /* user-written alias clause, if any */ + Alias *alias pg_node_attr(query_jumble_ignore); + /* expanded reference names */ + Alias *eref pg_node_attr(query_jumble_ignore); + RTEKind rtekind; /* see above */ /* @@ -1218,10 +1228,6 @@ typedef struct RangeTblEntry /* * Fields valid in all RTEs: */ - /* user-written alias clause, if any */ - Alias *alias pg_node_attr(query_jumble_ignore); - /* expanded reference names */ - Alias *eref pg_node_attr(query_jumble_ignore); /* was LATERAL specified? */ bool lateral pg_node_attr(query_jumble_ignore); /* present in FROM clause? */ |