Re: automatically generating node support functions

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: automatically generating node support functions
Date: 2021-06-11 19:23:53
Message-ID: 20210611192353.ugmjp2txdwp2duls@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2021-06-08 19:45:58 +0200, Peter Eisentraut wrote:
> On 08.06.21 15:40, David Rowley wrote:
> > It's almost 2 years ago now, but I'm wondering if you saw what Andres
> > proposed in [1]? The idea was basically to make a metadata array of
> > the node structs so that, instead of having to output large amounts of
> > .c code to do read/write/copy/equals, instead just have small
> > functions that loop over the elements in the array for the given
> > struct and perform the required operation based on the type.
>
> That project was technologically impressive, but it seemed to have
> significant hurdles to overcome before it can be useful. My proposal is
> usable and useful today. And it doesn't prevent anyone from working on a
> more sophisticated solution.

I think it's short-sighted to further and further go down the path of
parsing "kind of C" without just using a proper C parser. But leaving
that aside, a big part of the promise of the approach in that thread
isn't actually tied to the specific way the type information is
collected: The perl script could output something like the "node type
metadata" I generated in that patchset, and then we don't need the large
amount of generated code and can much more economically add additional
operations handling node types.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2021-06-11 19:26:13 Re: Decoding of two-phase xacts missing from CREATE_REPLICATION_SLOT command
Previous Message Andres Freund 2021-06-11 19:18:07 Re: [Proposal] Add accumulated statistics for wait event