Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tLSmr-00EwOI-Qj for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Dec 2024 19:54:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tLSmo-001muU-AN for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Dec 2024 19:54:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tLSmo-001muK-0i for pgsql-hackers@lists.postgresql.org; Wed, 11 Dec 2024 19:54:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tLSmi-002KNT-AF for pgsql-hackers@postgresql.org; Wed, 11 Dec 2024 19:54:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4BBJs8OB516760; Wed, 11 Dec 2024 14:54:08 -0500 From: Tom Lane To: Andres Freund cc: Andrei Lepikhov , PostgreSQL-development Subject: Re: Add Postgres module info In-reply-to: <2qdclwljzvw5abfvo4porr3ehox32icrbtfjaum327ruxts6qm@udexcbweewpq> References: <506788.1733941263@sss.pgh.pa.us> <2qdclwljzvw5abfvo4porr3ehox32icrbtfjaum327ruxts6qm@udexcbweewpq> Comments: In-reply-to Andres Freund message dated "Wed, 11 Dec 2024 14:26:12 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <516758.1733946848.1@sss.pgh.pa.us> Date: Wed, 11 Dec 2024 14:54:08 -0500 Message-ID: <516759.1733946848@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund 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