mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +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:
@ -4770,7 +4770,7 @@ ATRewriteCatalogs(List **wqueue, LOCKMODE lockmode,
|
||||
|
||||
foreach(lcmd, subcmds)
|
||||
ATExecCmd(wqueue, tab,
|
||||
castNode(AlterTableCmd, lfirst(lcmd)),
|
||||
lfirst_node(AlterTableCmd, lcmd),
|
||||
lockmode, pass, context);
|
||||
|
||||
/*
|
||||
@ -12842,7 +12842,7 @@ ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId, char *cmd,
|
||||
|
||||
foreach(lcmd, stmt->cmds)
|
||||
{
|
||||
AlterTableCmd *cmd = castNode(AlterTableCmd, lfirst(lcmd));
|
||||
AlterTableCmd *cmd = lfirst_node(AlterTableCmd, lcmd);
|
||||
|
||||
if (cmd->subtype == AT_AddIndex)
|
||||
{
|
||||
@ -16671,7 +16671,7 @@ transformPartitionSpec(Relation rel, PartitionSpec *partspec, char *strategy)
|
||||
/* take care of any partition expressions */
|
||||
foreach(l, partspec->partParams)
|
||||
{
|
||||
PartitionElem *pelem = castNode(PartitionElem, lfirst(l));
|
||||
PartitionElem *pelem = lfirst_node(PartitionElem, l);
|
||||
|
||||
if (pelem->expr)
|
||||
{
|
||||
@ -16708,7 +16708,7 @@ ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partParams, AttrNu
|
||||
attn = 0;
|
||||
foreach(lc, partParams)
|
||||
{
|
||||
PartitionElem *pelem = castNode(PartitionElem, lfirst(lc));
|
||||
PartitionElem *pelem = lfirst_node(PartitionElem, lc);
|
||||
Oid atttype;
|
||||
Oid attcollation;
|
||||
|
||||
|
Reference in New Issue
Block a user