Re: Add Postgres module info

Yurii Rashkovskii <yrashk@omnigres.com>

From: Yurii Rashkovskii <yrashk@omnigres.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrei Lepikhov <lepihov@gmail.com>, Euler Taveira <euler@eulerto.com>, Robert Haas <robertmhaas@gmail.com>, Michael Paquier <michael@paquier.xyz>, Alexander Korotkov <aekorotkov@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-03-27T13:38:43Z
Lists: pgsql-hackers

Attachments

On Wed, Mar 26, 2025 at 8:17 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Yurii Rashkovskii <yrashk@omnigres.com> writes:
> >> Can you propose a specific change to clean it up?  I wanted to write
> >> just "PG_MODULE_MAGIC_DATA()", but I'm not sure that's valid C either.
>
> > I was thinking about passing `.name = NULL, .version = NULL` instead of
> > `0`—do you have any reservations about this?
>
> If we're going that way, I'd minimize it to just ".name = NULL".
>

Would something like this work?

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.