>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
Tom> Experimentation shows that actually, the standard regression testsTom> provide dozens of opportunities for
find_relation_from_clausestoTom> fail on non-RestrictInfo input. However, it lacks any IsA check,
In a discussion with Andres on the hash grouping sets review thread, I
proposed that we should have something of the form
#define lfirst_node(_type_, l) (castNode(_type_,lfirst(l)))
to replace the current idiom of
foreach(l, blah) { SomeType *x = (SomeType *) lfirst(l);
(in my code I tend to omit the (SomeType *), which I dislike because it
adds no real protection)
by
foreach(l, blah) { SomeType *x = lfirst_node(SomeType, l);
in order to get that IsA check in there in a convenient way.
--
Andrew (irc:RhodiumToad)