Re: Add Postgres module info

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add Postgres module info
Date: 2024-12-11 19:54:08
Message-ID: 516759.1733946848@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 2024-12-11 13:21:03 -0500, Tom Lane wrote:
>> There are a couple of ways that we could deal with the API
>> seen by module authors:

> To be future proof, I think it'd be good to declare the arguments as
> designated initializers. E.g. like

> PG_MODULE_MAGIC_EXT(
> .version = 10000,
> .threadsafe = 1
> );

Yeah, I'd come to pretty much the same conclusion after sending
my email. That looks like it should work and be convenient
to extend further.

The other possibly-non-obvious bit is that we should probably
invent a sub-structure holding the ABI-related fields, so as to
minimize the amount of rewriting needed in dfmgr.c.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-12-11 20:21:06 Re: Make use of pg_memory_is_all_zeros() in more places
Previous Message Peter Geoghegan 2024-12-11 19:41:47 Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)