Re: Add Postgres module info - Mailing list pgsql-hackers

From Andrei Lepikhov
Subject Re: Add Postgres module info
Date
Msg-id 2c215c98-f713-4c5b-b21a-a4b8fa41890b@gmail.com
Whole thread Raw
In response to Re: Add Postgres module info  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Add Postgres module info
List pgsql-hackers
On 12/12/2024 01:21, Tom Lane wrote:
> Andrei Lepikhov <lepihov@gmail.com> writes:
>> I would like to propose the module_info structure, which aims to let
>> extension maintainers sew some data into the binary file. Being included
>> in the module code, this information remains unchanged and is available
>> for reading by a backend.
> 
> I don't have much of an opinion one way or the other about the
> usefulness of these additional info fields.  But I would like to
> object to the way you've gone about it, namely to copy-and-paste
> the magic-block mechanism.  That doesn't scale: the next time
> somebody else wants some more fields, will we have three such
> structs?
It makes sense. But I want to clarify that I avoided changing 
PG_MODULE_MAGIC because the newly introduced structure has a totally 
different purpose and usage logic: the struct is designed to check 
compatibility, but module info isn't connected to the core version at 
all: a single version of the code may be built for multiple PG versions. 
At the same time, various versions of the same library may be usable 
with the same core.

 From the coding point of view, I agree that your approach is more 
laconic and reasonable. I will rewrite the code using this approach.

-- 
regards, Andrei Lepikhov



pgsql-hackers by date:

Previous
From: "Euler Taveira"
Date:
Subject: Re: Add Postgres module info
Next
From: Tom Lane
Date:
Subject: Re: Add Postgres module info