Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4080fa

Browse files
committed
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]
1 parent 367c989 commit b4080fa

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

src/backend/nodes/outfuncs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,6 @@ _outRangeTblEntry(StringInfo str, const RangeTblEntry *node)
494494
{
495495
WRITE_NODE_TYPE("RANGETBLENTRY");
496496

497-
/* put alias + eref first to make dump more legible */
498497
WRITE_NODE_FIELD(alias);
499498
WRITE_NODE_FIELD(eref);
500499
WRITE_ENUM_FIELD(rtekind, RTEKind);

src/backend/nodes/readfuncs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ _readRangeTblEntry(void)
348348
{
349349
READ_LOCALS(RangeTblEntry);
350350

351-
/* put alias + eref first to make dump more legible */
352351
READ_NODE_FIELD(alias);
353352
READ_NODE_FIELD(eref);
354353
READ_ENUM_FIELD(rtekind, RTEKind);

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
*/
5858

5959
/* yyyymmddN */
60-
#define CATALOG_VERSION_NO 202403202
60+
#define CATALOG_VERSION_NO 202403221
6161

6262
#endif

src/include/nodes/parsenodes.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,16 @@ typedef struct RangeTblEntry
10271027

10281028
NodeTag type;
10291029

1030+
/*
1031+
* Fields valid in all RTEs:
1032+
*
1033+
* put alias + eref first to make dump more legible
1034+
*/
1035+
/* user-written alias clause, if any */
1036+
Alias *alias pg_node_attr(query_jumble_ignore);
1037+
/* expanded reference names */
1038+
Alias *eref pg_node_attr(query_jumble_ignore);
1039+
10301040
RTEKind rtekind; /* see above */
10311041

10321042
/*
@@ -1218,10 +1228,6 @@ typedef struct RangeTblEntry
12181228
/*
12191229
* Fields valid in all RTEs:
12201230
*/
1221-
/* user-written alias clause, if any */
1222-
Alias *alias pg_node_attr(query_jumble_ignore);
1223-
/* expanded reference names */
1224-
Alias *eref pg_node_attr(query_jumble_ignore);
12251231
/* was LATERAL specified? */
12261232
bool lateral pg_node_attr(query_jumble_ignore);
12271233
/* present in FROM clause? */

0 commit comments

Comments
 (0)