From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Add missing support for new node fields
Date: Tue, 21 Mar 2017 10:56:13 -0400
Message-ID: <31303.1490108173@sss.pgh.pa.us> (raw)
In-Reply-To: <20170321062850.koa557zw3gqyl4lm@alap3.anarazel.de>
References: <E1cq93r-0004ey-Mp@gemulon.postgresql.org>
<alpine.DEB.2.20.1703210716370.22282@lancre>
<20170321062850.koa557zw3gqyl4lm@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Andres Freund <andres@anarazel.de> writes:
> On 2017-03-21 07:22:57 +0100, Fabien COELHO wrote:
>> I've been annoyed by these stupid functions and forgetting to update them
>> since I run into them while trying to fix an issue in pg_stat_statement some
>> time ago.
>>
>> I've started to develop a perl script to generate most of them from headers.
>> It is not done yet, but it looks that it can work in the end with limited
>> effort. Currently it works for copy & equal.
> It'd have to do out/read as well imo.
Yeah. A partial solution is pretty much useless. Even with out/read
support as well, I'm not sure it's not useless, because you'd still
have to remember to consider places like expression_tree_walker and
expression_tree_mutator. Those are not really amenable to automatic
generation AFAICS, because they have to understand the actual semantics
of each field.
It's conceivable that you could get somewhere if the starting point were
some marked-up representation of every node type's field list, rather than
just a C declaration. (IOW, include/nodes/*.h would become generated
files as well.) But really, isn't that just moving the error locale from
"forgetting to update equalfuncs.c" to "forgetting to include the correct
marker keywords"? And people would have to learn about this generator
tool and its input language.
In the end there's very little substitute for checking every reference
to a struct type when you add/modify one of its fields. grep is your
friend.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, coelho@cri.ensmp.fr, andrew@dunslane.net, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Add missing support for new node fields
In-Reply-To: <31303.1490108173@sss.pgh.pa.us>
References: <E1cq93r-0004ey-Mp@gemulon.postgresql.org> <alpine.DEB.2.20.1703210716370.22282@lancre> <20170321062850.koa557zw3gqyl4lm@alap3.anarazel.de> <31303.1490108173@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox