Re: automatically generating node support functions
От
Peter Eisentraut
Тема
Re: automatically generating node support functions
Дата
Msg-id
7848b872-7a10-67b2-b55f-7c9c475ae863@enterprisedb.com
Ответ на
Re: automatically generating node support functions (Andrew Dunstan)
Список
Дерево обсуждения
automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Andrew Dunstan <andrew@dunslane.net>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: automatically generating node support functions David Rowley <dgrowleyml@gmail.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Amit Kapila <amit.kapila16@gmail.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Amit Kapila <amit.kapila16@gmail.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Amit Kapila <amit.kapila16@gmail.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Amit Kapila <amit.kapila16@gmail.com>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Robert Haas <robertmhaas@gmail.com>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Robert Haas <robertmhaas@gmail.com>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Corey Huinker <corey.huinker@gmail.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Jacob Champion <pchampion@vmware.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Noah Misch <noah@leadboat.com>
Re: automatically generating node support functions David Rowley <dgrowleyml@gmail.com>
Re: automatically generating node support functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
Re: automatically generating node support functions Tom Lane <tgl@sss.pgh.pa.us>
Re: automatically generating node support functions Andres Freund <andres@anarazel.de>
On 12.10.21 15:52, Andrew Dunstan wrote:
> I haven't been through the whole thing, but I did notice this: the
> comment stripping code looks rather fragile. I think it would blow up if
> there were a continuation line not starting with qr/\s*\*/. It's a lot
> simpler and more robust to do this if you slurp the file in whole.
> Here's what we do in the buildfarm code:
>
> my $src = file_contents($_);
> # strip C comments
> # We used to use the recipe in perlfaq6 but there is actually no point.
> # We don't need to keep the quoted string values anyway, and
> # on some platforms the complex regex causes perl to barf and crash.
> $src =~ s{/\*.*?\*/}{}gs;
>
> After you've done that splitting it into lines is pretty simple.
Here is an updated patch, with some general rebasing, and the above
improvement. It now also generates #include lines necessary in
copyfuncs etc. to pull in all the node types it operates on.
Further, I have looked more into the "metadata" approach discussed in
[0]. It's pretty easy to generate that kind of output from the data
structures my script produces. You just loop over all the node types
and print stuff and keep a few counters. I don't plan to work on that
at this time, but I just wanted to point out that if people wanted to
move into that direction, my patch wouldn't be in the way.
[0]:
https://www.postgresql.org/message-id/flat/20190828234136.fk2ndqtld3onfrrp%40alap3.anarazel.deВ списке pgsql-hackers по дате отправления
От: Anton Voloshin
Дата: