Re: What about a castNode() macro? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: What about a castNode() macro?
Date
Msg-id 9403.1398792770@sss.pgh.pa.us
Whole thread Raw
In response to What about a castNode() macro?  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> There's a repeated pattern of

> Assert(IsA(ptr, nodetype));
> foo = (nodetype *) ptr;

> how about adding a castNode() that combines those?

Doesn't really seem worth it.  The notational advantage is not great,
and to the extent that it were to touch a lot of places, the main outcome
would be pain for back-patching.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Keith Fiske
Date:
Subject: Re: pg_dump --pretty-print-views
Next
From: Greg Stark
Date:
Subject: Re: pg_dump --pretty-print-views