Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltyOu-0000Yp-QP for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Jun 2021 20:14:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ltyOt-00026d-6I for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Jun 2021 20:14:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltyOs-00026V-Uy for pgsql-hackers@lists.postgresql.org; Thu, 17 Jun 2021 20:14:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltyOm-0006Wb-QU for pgsql-hackers@lists.postgresql.org; Thu, 17 Jun 2021 20:14:05 +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 15HKDuuG1056663; Thu, 17 Jun 2021 16:13:56 -0400 From: Tom Lane To: Robert Haas cc: Boris Kolpackov , PostgreSQL Hackers , =?UTF-8?Q?=C3=81lvaro_Herrera?= Subject: Re: Add version macro to libpq-fe.h In-reply-to: References: <968815.1623936849@sss.pgh.pa.us> <1026744.1623950177@sss.pgh.pa.us> <1036264.1623954858@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Thu, 17 Jun 2021 15:47:33 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1056661.1623960836.1@sss.pgh.pa.us> Date: Thu, 17 Jun 2021 16:13:56 -0400 Message-ID: <1056662.1623960836@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Thu, Jun 17, 2021 at 2:34 PM Tom Lane wrote: >> ... Just because the >> version-number approach offloads work from us doesn't make it a good >> idea, because the work doesn't vanish; it will be dumped in the laps >> of packagers and end users. > What work? Including an additional #define in a header file doesn't > create any work for packagers or end-users that I can see. If > anything, it seems easier for end-users. If you want a function that > first appears in v16, just test whether the version number is >= 16. You're omitting the step of "figure out which version the feature you want to use appeared in". A few years down the road, that'll get harder than it might seem to be for a shiny new feature. As for the packagers, this creates a requirement to include the right version of the right file in the right sub-package. Admittedly, if we hack things so that the #define appears directly in libpq-fe.h through some configure magic, then there's nothing extra for packagers to get right; but if we put it anywhere else, we're adding ways for them to get it wrong. > On the other hand if we promise to add at least one #define to that > file for each new release, New libpq API feature, not every new release. I don't really see that that's much harder than, say, bumping catversion. > ... then somebody's got to be like, oh, let's > see, this function was added in v16, now which #define got added in > that release ... hmm, let me go diff the branches in git ... how is > that any better? I repeat that you are evaluating this through the lens of how much work it is for us as opposed to other people, and I fundamentally disagree with that being the primary metric. regards, tom lane