mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
Use l*_node() family of functions where appropriate
Instead of castNode(…, lfoo(…)) Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Discussion: https://www.postgresql.org/message-id/flat/87eecahraj.fsf@wibble.ilmari.org
This commit is contained in:
@@ -2807,7 +2807,7 @@ transformWindowDefinitions(ParseState *pstate,
|
||||
(errcode(ERRCODE_WINDOWING_ERROR),
|
||||
errmsg("RANGE with offset PRECEDING/FOLLOWING requires exactly one ORDER BY column"),
|
||||
parser_errposition(pstate, windef->location)));
|
||||
sortcl = castNode(SortGroupClause, linitial(wc->orderClause));
|
||||
sortcl = linitial_node(SortGroupClause, wc->orderClause);
|
||||
sortkey = get_sortgroupclause_expr(sortcl, *targetlist);
|
||||
/* Find the sort operator in pg_amop */
|
||||
if (!get_ordering_op_properties(sortcl->sortop,
|
||||
|
@@ -2424,7 +2424,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
|
||||
/* Make sure referenced column exists. */
|
||||
foreach(columns, cxt->columns)
|
||||
{
|
||||
column = castNode(ColumnDef, lfirst(columns));
|
||||
column = lfirst_node(ColumnDef, columns);
|
||||
if (strcmp(column->colname, key) == 0)
|
||||
{
|
||||
found = true;
|
||||
@@ -2462,7 +2462,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
|
||||
|
||||
foreach(inher, cxt->inhRelations)
|
||||
{
|
||||
RangeVar *inh = castNode(RangeVar, lfirst(inher));
|
||||
RangeVar *inh = lfirst_node(RangeVar, inher);
|
||||
Relation rel;
|
||||
int count;
|
||||
|
||||
@@ -4088,7 +4088,7 @@ transformPartitionBound(ParseState *pstate, Relation parent,
|
||||
duplicate = false;
|
||||
foreach(cell2, result_spec->listdatums)
|
||||
{
|
||||
Const *value2 = castNode(Const, lfirst(cell2));
|
||||
Const *value2 = lfirst_node(Const, cell2);
|
||||
|
||||
if (equal(value, value2))
|
||||
{
|
||||
@@ -4267,7 +4267,7 @@ validateInfiniteBounds(ParseState *pstate, List *blist)
|
||||
|
||||
foreach(lc, blist)
|
||||
{
|
||||
PartitionRangeDatum *prd = castNode(PartitionRangeDatum, lfirst(lc));
|
||||
PartitionRangeDatum *prd = lfirst_node(PartitionRangeDatum, lc);
|
||||
|
||||
if (kind == prd->kind)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user