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 1ltwqy-0006BS-As for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Jun 2021 18:35:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ltwqR-0007Id-ON for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Jun 2021 18:34:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltwqR-0007Hs-GS for pgsql-hackers@lists.postgresql.org; Thu, 17 Jun 2021 18:34:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltwqN-0006P5-LZ for pgsql-hackers@lists.postgresql.org; Thu, 17 Jun 2021 18:34:27 +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 15HIYI5g1036265; Thu, 17 Jun 2021 14:34:18 -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> Comments: In-reply-to Robert Haas message dated "Thu, 17 Jun 2021 14:15:44 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1036263.1623954858.1@sss.pgh.pa.us> Date: Thu, 17 Jun 2021 14:34:18 -0400 Message-ID: <1036264.1623954858@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > I just went and looked at how exports.txt has evolved over the years. > Since PostgreSQL 8.1, every release except for 9.4 and 11 added at > least one new function to libpq. That means in 14 releases we've done > something that might break someone's compile 12 times. Now maybe you > want to try to argue that few of those changes are "major," but I > don't know how that could be a principled argument. Every new function > is something someone may want to use, and thus a potential compile > break. Interesting, but then you have to explain why this is the first time that somebody has asked for a version number in libpq-fe.h. Maybe all those previous additions were indeed minor enough that the problem didn't come up. (Another likely possibility, perhaps, is that people have been misusing the server version for this purpose, and have been lucky enough to not have that approach fail for them.) Anyway, I do not see why we can't establish a principle going forward that new additions to libpq's API should involve at least one macro, so that they can be checked for with #ifdefs. 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. BTW, by that principle, we should likely be adding a symbol associated with the new tracing features, as well as one for pipelining. Or is it good enough to tell people they can check "#ifdef PQTRACE_SUPPRESS_TIMESTAMPS" ? regards, tom lane