1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-04 20:11:56 +03:00

Remove custom _jumbleRangeTblEntry()

This is part of an effort to reduce the number of special cases in the
automatically generated node support functions.

This patch removes _jumbleRangeTblEntry() and instead adds per-field
query_jumble_ignore annotations to match the behavior of the previous
custom code.  The pg_stat_statements test suite has some coverage of
this.  It gets rid of the switch on rtekind; this should be
technically correct, since we do the equal and copy functions like
this also.

The list of fields to jumble has been checked and is considered
correct as of 8b29a119fd.

Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://www.postgresql.org/message-id/flat/4b27fc50-8cd6-46f5-ab20-88dbaadca645@eisentraut.org
This commit is contained in:
Peter Eisentraut
2024-03-22 07:12:28 +01:00
parent d575051b9a
commit 367c989cd8
2 changed files with 20 additions and 69 deletions

View File

@@ -353,52 +353,3 @@ _jumbleA_Const(JumbleState *jstate, Node *node)
}
}
}
static void
_jumbleRangeTblEntry(JumbleState *jstate, Node *node)
{
RangeTblEntry *expr = (RangeTblEntry *) node;
JUMBLE_FIELD(rtekind);
switch (expr->rtekind)
{
case RTE_RELATION:
JUMBLE_FIELD(relid);
JUMBLE_FIELD(inh);
JUMBLE_NODE(tablesample);
break;
case RTE_SUBQUERY:
JUMBLE_NODE(subquery);
break;
case RTE_JOIN:
JUMBLE_FIELD(jointype);
break;
case RTE_FUNCTION:
JUMBLE_NODE(functions);
JUMBLE_FIELD(funcordinality);
break;
case RTE_TABLEFUNC:
JUMBLE_NODE(tablefunc);
break;
case RTE_VALUES:
JUMBLE_NODE(values_lists);
break;
case RTE_CTE:
/*
* Depending on the CTE name here isn't ideal, but it's the only
* info we have to identify the referenced WITH item.
*/
JUMBLE_STRING(ctename);
JUMBLE_FIELD(ctelevelsup);
break;
case RTE_NAMEDTUPLESTORE:
JUMBLE_STRING(enrname);
break;
case RTE_RESULT:
break;
default:
elog(ERROR, "unrecognized RTE kind: %d", (int) expr->rtekind);
break;
}
}