Re: Use IsA() macro instead of nodeTag comparison

Shinya Kato <shinya11.kato@gmail.com>

From: Shinya Kato <shinya11.kato@gmail.com>
To: Chao Li <li.evan.chao@gmail.com>
Cc: Fujii Masao <masao.fujii@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>, Kirill Reshke <reshkekirill@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-09T02:19:14Z
Lists: pgsql-hackers
On Fri, Jan 9, 2026 at 9:56 AM Chao Li <li.evan.chao@gmail.com> wrote:
>
> > I found a similar issue in define.c. Should we fix it there as well?
> >
> > diff --git a/src/backend/commands/define.c b/src/backend/commands/define.c
> > index 63601a2c0b4..8313431397f 100644
> > --- a/src/backend/commands/define.c
> > +++ b/src/backend/commands/define.c
> > @@ -349,7 +349,7 @@ defGetStringList(DefElem *def)
> >                                (errcode(ERRCODE_SYNTAX_ERROR),
> >                                 errmsg("%s requires a parameter",
> >                                                def->defname)));
> > -       if (nodeTag(def->arg) != T_List)
> > +       if (!IsA(def->arg, List))
> >                elog(ERROR, "unrecognized node type: %d", (int)
> > nodeTag(def->arg));
> >
> >        foreach(cell, (List *) def->arg)
> >
>
> Yep, I did a search with `nodeTag\(.*\)\s+(?:!=|==).*`, and this is the only finding.

Oh, I missed that, sorry. Thanks, LGTM.


-- 
Best regards,
Shinya Kato
NTT OSS Center



Commits

  1. Use IsA() macro in define.c, for sake of consistency.

  2. Use IsA macro, for sake of consistency