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 1sbLDS-00Fsr9-O1 for pgsql-general@arkaria.postgresql.org; Tue, 06 Aug 2024 14:31:10 +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 1sbLDR-000GeU-4C for pgsql-general@arkaria.postgresql.org; Tue, 06 Aug 2024 14:31:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sbLDQ-000GeG-PX for pgsql-general@lists.postgresql.org; Tue, 06 Aug 2024 14:31:08 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sbLDO-003OLU-A2 for pgsql-general@lists.postgresql.org; Tue, 06 Aug 2024 14:31:07 +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 476EV4t51340431; Tue, 6 Aug 2024 10:31:04 -0400 From: Tom Lane To: Dominique Devienne cc: pgsql-general@lists.postgresql.org Subject: Re: libpq version macro to use or not PQsocketPoll In-reply-to: References: Comments: In-reply-to Dominique Devienne message dated "Tue, 06 Aug 2024 15:28:21 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1340429.1722954664.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 06 Aug 2024 10:31:04 -0400 Message-ID: <1340430.1722954664@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dominique Devienne writes: > Hi. Now that v17beta2 is part of my dev-env, I'm trying out the new API. > And I discover there's no version macro for conditional compilation in L= IBPQ... Indeed, that's an oversight, and there's a number of other things we added to libpq-fe.h between 16 and 17 that probably deserve their own LIBPQ_HAS symbols. > I'm not sure what's so wrong with version macro as such. A couple of things: * It doesn't help if we forget to update it, so it's not really better than HAS_ symbols on that score. * Usage is error-prone (you might test for the wrong cutoff version) and not very readable. * We can't retroactively make such a symbol appear in old copies of libpq-fe.h. regards, tom lane