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 1luEvX-0007So-EP for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jun 2021 13:52:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1luEvW-0007hn-AY for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jun 2021 13:52:54 +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 1luEvV-0007hf-SI for pgsql-hackers@lists.postgresql.org; Fri, 18 Jun 2021 13:52:54 +0000 Received: from codesynthesis.com ([188.40.148.39]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luEvS-0006Dl-UX for pgsql-hackers@lists.postgresql.org; Fri, 18 Jun 2021 13:52:52 +0000 Received: from brak.codesynthesis.com (unknown [105.225.47.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by codesynthesis.com (Postfix) with ESMTPSA id 05551602CD; Fri, 18 Jun 2021 13:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codesynthesis.com; s=mail1; t=1624024366; bh=dQl1vJ9nrjbiodWy0d+IevY0I+bPreFcNBOa2Cydxmk=; h=Date:From:To:Subject:Message-ID:MIME-Version:From; b=frGjzq87K3D7CgCreh6Q8EjL75PEVkbvChiinNMvDVkjENM5JiJIyVnOlcTffM9Mf n7mX109tQmM+hLuj+lvV3B2vsOKysogdPZAK/Ay8J5DnUNDsZZGHfKZBwPuVIaYhiC N16MHibelr7HHlFdhQlKl7l8g8JiRNCQbrufLwGF7aHh3a6itYlvRLL69CXAsjoICq lMolXgS+JQFoviQVBJp6d9DL5x2+9zfJZAxWleEExH2xsmGv5eo/00P2W8wvobm2+i 7ErRMC18cuXXPxVJoNUAUsOzEVBcb9LRPp8msKV84FCEP7WAX42nvtQazFCHKNPs4N 6fUstvp+h//FQ== Received: by brak.codesynthesis.com (Postfix, from userid 1000) id 0DC621A802C0; Fri, 18 Jun 2021 15:52:41 +0200 (SAST) Date: Fri, 18 Jun 2021 15:52:41 +0200 From: Boris Kolpackov To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org, alvaro.herrera@2ndquadrant.com Subject: Re: Add version macro to libpq-fe.h Message-ID: References: <968815.1623936849@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <968815.1623936849@sss.pgh.pa.us> Organization: Code Synthesis User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tom Lane writes: > I think putting a version number as such in there is a truly > horrid idea. However, I could get behind adding a boolean flag > that says specifically whether the pipeline feature exists. > Then you'd do something like > > #ifdef LIBPQ_HAS_PIPELINING > > rather than embedding knowledge of exactly which release > added that. That would be even better, but I agree with what others have said: we would have to keep adding such feature test macros going forward. I think ideally you would want to have both since the version macro could still be helpful in dealing with "features" that you did not plan to add (aka bugs). > Comparing v13 and v14 libpq-fe.h, I see that there is a solution > available now: "#ifdef PQ_QUERY_PARAM_MAX_LIMIT". Hm, it must have been added recently since I don't see it in 14beta1. But thanks for the pointer, if nothing better comes up this will have to do.