Re: automatically generating node support functions

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: automatically generating node support functions
Date: 2022-01-24 15:15:48
Message-ID: 40a2e977-98ba-0c01-af6c-9dfb39e864ba@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rebased patch to resolve some merge conflicts

On 29.12.21 12:08, Peter Eisentraut wrote:
> 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

Attachment Content-Type Size
v4-0001-Automatically-generate-node-support-functions.patch text/plain 71.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-01-24 15:50:17 Re: UNIQUE null treatment option
Previous Message David G. Johnston 2022-01-24 14:42:34 Re: Skipping logical replication transactions on subscriber side