Re: automatically generating node support functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: automatically generating node support functions
Date: 2021-07-14 21:42:10
Message-ID: 3569906.1626298930@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> 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]?

>> 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.

I think the main reason that the previous patch went nowhere was general
resistance to making developers install something as complicated as
libclang --- that could be a big lift on non-mainstream platforms.
So IMO it's a feature not a bug that Peter's approach just uses a perl
script. OTOH, the downstream aspects of your patch did seem appealing.
So I'd like to see a merger of the two approaches, using perl for the
data extraction and then something like what you'd done. Maybe that's
the same thing you're saying.

I also see Peter's point that committing what he has here might be
a reasonable first step on that road. Getting the data extraction
right is a big chunk of the job, and what we do with it afterward
could be improved later.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-07-14 22:18:05 Re: postgres_fdw - make cached connection functions tests meaningful
Previous Message Daniel Gustafsson 2021-07-14 21:34:51 Re: Avoid repeated PQfnumber() in pg_dump