Skip to content

Commit e581360

Browse files
committed
Make node output prefix match node structure name
In most cases, the prefix string in a node output is the upper case of the node structure name, e.g., MergeAppend -> MERGEAPPEND. There were a few exceptions that for either no apparent reason or perhaps minor aesthetic reasons deviated from this. In order to simplify this and perhaps allow automatic generation without having to deal with exception cases, make them all match. Discussion: https://www.postgresql.org/message-id/c091e5cd-45f8-69ee-6a9b-de86912cc7e7@enterprisedb.com
1 parent 851ff93 commit e581360

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/backend/nodes/outfuncs.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ _outConvertRowtypeExpr(StringInfo str, const ConvertRowtypeExpr *node)
14721472
static void
14731473
_outCollateExpr(StringInfo str, const CollateExpr *node)
14741474
{
1475-
WRITE_NODE_TYPE("COLLATE");
1475+
WRITE_NODE_TYPE("COLLATEEXPR");
14761476

14771477
WRITE_NODE_FIELD(arg);
14781478
WRITE_OID_FIELD(collOid);
@@ -1482,7 +1482,7 @@ _outCollateExpr(StringInfo str, const CollateExpr *node)
14821482
static void
14831483
_outCaseExpr(StringInfo str, const CaseExpr *node)
14841484
{
1485-
WRITE_NODE_TYPE("CASE");
1485+
WRITE_NODE_TYPE("CASEEXPR");
14861486

14871487
WRITE_OID_FIELD(casetype);
14881488
WRITE_OID_FIELD(casecollid);
@@ -1495,7 +1495,7 @@ _outCaseExpr(StringInfo str, const CaseExpr *node)
14951495
static void
14961496
_outCaseWhen(StringInfo str, const CaseWhen *node)
14971497
{
1498-
WRITE_NODE_TYPE("WHEN");
1498+
WRITE_NODE_TYPE("CASEWHEN");
14991499

15001500
WRITE_NODE_FIELD(expr);
15011501
WRITE_NODE_FIELD(result);
@@ -1515,7 +1515,7 @@ _outCaseTestExpr(StringInfo str, const CaseTestExpr *node)
15151515
static void
15161516
_outArrayExpr(StringInfo str, const ArrayExpr *node)
15171517
{
1518-
WRITE_NODE_TYPE("ARRAY");
1518+
WRITE_NODE_TYPE("ARRAYEXPR");
15191519

15201520
WRITE_OID_FIELD(array_typeid);
15211521
WRITE_OID_FIELD(array_collid);
@@ -1528,7 +1528,7 @@ _outArrayExpr(StringInfo str, const ArrayExpr *node)
15281528
static void
15291529
_outRowExpr(StringInfo str, const RowExpr *node)
15301530
{
1531-
WRITE_NODE_TYPE("ROW");
1531+
WRITE_NODE_TYPE("ROWEXPR");
15321532

15331533
WRITE_NODE_FIELD(args);
15341534
WRITE_OID_FIELD(row_typeid);
@@ -1540,7 +1540,7 @@ _outRowExpr(StringInfo str, const RowExpr *node)
15401540
static void
15411541
_outRowCompareExpr(StringInfo str, const RowCompareExpr *node)
15421542
{
1543-
WRITE_NODE_TYPE("ROWCOMPARE");
1543+
WRITE_NODE_TYPE("ROWCOMPAREEXPR");
15441544

15451545
WRITE_ENUM_FIELD(rctype, RowCompareType);
15461546
WRITE_NODE_FIELD(opnos);
@@ -1553,7 +1553,7 @@ _outRowCompareExpr(StringInfo str, const RowCompareExpr *node)
15531553
static void
15541554
_outCoalesceExpr(StringInfo str, const CoalesceExpr *node)
15551555
{
1556-
WRITE_NODE_TYPE("COALESCE");
1556+
WRITE_NODE_TYPE("COALESCEEXPR");
15571557

15581558
WRITE_OID_FIELD(coalescetype);
15591559
WRITE_OID_FIELD(coalescecollid);
@@ -1564,7 +1564,7 @@ _outCoalesceExpr(StringInfo str, const CoalesceExpr *node)
15641564
static void
15651565
_outMinMaxExpr(StringInfo str, const MinMaxExpr *node)
15661566
{
1567-
WRITE_NODE_TYPE("MINMAX");
1567+
WRITE_NODE_TYPE("MINMAXEXPR");
15681568

15691569
WRITE_OID_FIELD(minmaxtype);
15701570
WRITE_OID_FIELD(minmaxcollid);
@@ -2807,7 +2807,7 @@ _outAlterStatsStmt(StringInfo str, const AlterStatsStmt *node)
28072807
static void
28082808
_outNotifyStmt(StringInfo str, const NotifyStmt *node)
28092809
{
2810-
WRITE_NODE_TYPE("NOTIFY");
2810+
WRITE_NODE_TYPE("NOTIFYSTMT");
28112811

28122812
WRITE_STRING_FIELD(conditionname);
28132813
WRITE_STRING_FIELD(payload);
@@ -2816,7 +2816,7 @@ _outNotifyStmt(StringInfo str, const NotifyStmt *node)
28162816
static void
28172817
_outDeclareCursorStmt(StringInfo str, const DeclareCursorStmt *node)
28182818
{
2819-
WRITE_NODE_TYPE("DECLARECURSOR");
2819+
WRITE_NODE_TYPE("DECLARECURSORSTMT");
28202820

28212821
WRITE_STRING_FIELD(portalname);
28222822
WRITE_INT_FIELD(options);
@@ -3238,7 +3238,7 @@ _outSetOperationStmt(StringInfo str, const SetOperationStmt *node)
32383238
static void
32393239
_outRangeTblEntry(StringInfo str, const RangeTblEntry *node)
32403240
{
3241-
WRITE_NODE_TYPE("RTE");
3241+
WRITE_NODE_TYPE("RANGETBLENTRY");
32423242

32433243
/* put alias + eref first to make dump more legible */
32443244
WRITE_NODE_FIELD(alias);

src/backend/nodes/readfuncs.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,23 +2795,23 @@ parseNodeString(void)
27952795
return_value = _readArrayCoerceExpr();
27962796
else if (MATCH("CONVERTROWTYPEEXPR", 18))
27972797
return_value = _readConvertRowtypeExpr();
2798-
else if (MATCH("COLLATE", 7))
2798+
else if (MATCH("COLLATEEXPR", 11))
27992799
return_value = _readCollateExpr();
2800-
else if (MATCH("CASE", 4))
2800+
else if (MATCH("CASEEXPR", 8))
28012801
return_value = _readCaseExpr();
2802-
else if (MATCH("WHEN", 4))
2802+
else if (MATCH("CASEWHEN", 8))
28032803
return_value = _readCaseWhen();
28042804
else if (MATCH("CASETESTEXPR", 12))
28052805
return_value = _readCaseTestExpr();
2806-
else if (MATCH("ARRAY", 5))
2806+
else if (MATCH("ARRAYEXPR", 9))
28072807
return_value = _readArrayExpr();
2808-
else if (MATCH("ROW", 3))
2808+
else if (MATCH("ROWEXPR", 7))
28092809
return_value = _readRowExpr();
2810-
else if (MATCH("ROWCOMPARE", 10))
2810+
else if (MATCH("ROWCOMPAREEXPR", 14))
28112811
return_value = _readRowCompareExpr();
2812-
else if (MATCH("COALESCE", 8))
2812+
else if (MATCH("COALESCEEXPR", 12))
28132813
return_value = _readCoalesceExpr();
2814-
else if (MATCH("MINMAX", 6))
2814+
else if (MATCH("MINMAXEXPR", 10))
28152815
return_value = _readMinMaxExpr();
28162816
else if (MATCH("SQLVALUEFUNCTION", 16))
28172817
return_value = _readSQLValueFunction();
@@ -2845,17 +2845,17 @@ parseNodeString(void)
28452845
return_value = _readOnConflictExpr();
28462846
else if (MATCH("APPENDRELINFO", 13))
28472847
return_value = _readAppendRelInfo();
2848-
else if (MATCH("RTE", 3))
2848+
else if (MATCH("RANGETBLENTRY", 13))
28492849
return_value = _readRangeTblEntry();
28502850
else if (MATCH("RANGETBLFUNCTION", 16))
28512851
return_value = _readRangeTblFunction();
28522852
else if (MATCH("TABLESAMPLECLAUSE", 17))
28532853
return_value = _readTableSampleClause();
2854-
else if (MATCH("NOTIFY", 6))
2854+
else if (MATCH("NOTIFYSTMT", 10))
28552855
return_value = _readNotifyStmt();
28562856
else if (MATCH("DEFELEM", 7))
28572857
return_value = _readDefElem();
2858-
else if (MATCH("DECLARECURSOR", 13))
2858+
else if (MATCH("DECLARECURSORSTMT", 17))
28592859
return_value = _readDeclareCursorStmt();
28602860
else if (MATCH("PLANNEDSTMT", 11))
28612861
return_value = _readPlannedStmt();

0 commit comments

Comments
 (0)