Re: Add Postgres module info

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Euler Taveira <euler@eulerto.com>, Andres Freund <andres@anarazel.de>, Andrei Lepikhov <lepihov@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-12-12T03:44:34Z
Lists: pgsql-hackers
On Wed, Dec 11, 2024 at 10:39:38PM -0500, Tom Lane wrote:
> Michael Paquier <michael@paquier.xyz> writes:
>> Presumably,
>> the extra tracking can be done in dfmgr.c with more fields added to
>> DynamicFileList to track the information involved.
> 
> I wouldn't add any overhead to the normal case for this.  Couldn't
> we walk the list and re-fetch each module's magic block inside
> this new function?

Depends on how much we should try to cache to make that less expensive
on repeated calls because we cannot unload libraries, but sure, I
don't see why we could not that for each SQL function call to simplify
the logic and the structures in place.
--
Michael

Commits

  1. Avoid mixing designated and non-designated field initializers.

  2. Use PG_MODULE_MAGIC_EXT in our installable shared libraries.

  3. Introduce PG_MODULE_MAGIC_EXT macro.