Re: Department of Redundancy Department: makeNode(FuncCall) division - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Department of Redundancy Department: makeNode(FuncCall) division
Date
Msg-id 20130628150415.GA925704@tornado.leadboat.com
Whole thread Raw
In response to Re: Department of Redundancy Department: makeNode(FuncCall) division  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jun 28, 2013 at 10:31:16AM -0400, Tom Lane wrote:
> David Fetter <david@fetter.org> writes:
> > Please find attached the latest patch.
> 
> I remain of the opinion that this is simply a bad idea.  It is unlike
> our habits for constructing other types of nodes, and makes it harder
> not easier to find all the places that need to be updated when adding
> another field to FuncCall.

We have precedents in makeRangeVar() and makeDefElem().

For me, this change would make it slightly easier to visit affected code sites
after a change.  I could cscope for callers of makeFuncCall() instead of doing
"git grep 'makeNode(FuncCall)'".  The advantage could go either way depending
on your tooling, though.

By having each call site only mention the seldom-used fields for which it does
something special, the distinctive aspects of the call site stand out better.
That's a nice advantage.

-- 
Noah Misch
EnterpriseDB                                 http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: extensible external toast tuple support
Next
From: Andres Freund
Date:
Subject: Re: changeset generation v5-01 - Patches & git tree