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 1luFcg-0000NS-GZ for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jun 2021 14:37:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1luFcf-0001Ez-By for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jun 2021 14:37:29 +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 1luFTQ-0002jS-G5 for pgsql-hackers@lists.postgresql.org; Fri, 18 Jun 2021 14:27:56 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1luFTN-0006ZU-HU for pgsql-hackers@lists.postgresql.org; Fri, 18 Jun 2021 14:27:55 +0000 Received: by mail-qk1-x731.google.com with SMTP id f70so11297134qke.13 for ; Fri, 18 Jun 2021 07:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=OVFfxsfUxJFZiqwJsIdPxjw6niT0Wd62vvSC3Vd6CQA=; b=p+tsoJI2pN21YcVZi9fEB81TU05snAm/k4EfK9A6QhWU+ptNNQSIbDrXiZR4xEOCL5 /PLfdT/+qudvBwlzmEgXbKg/Qp31/69IiRLwlG2yhvTzaJjjn2yuiSIM4jXFQVGO2tFj 0nmdk5FGyTFJnur4cledWuxicYFsdOcpx7ZkdpbZNRf7ZmxPtugLjxVIHbnLD2G6Hifg G4HWrSCRaFkZ9oXuPR1wd7BOa1si4DQ3cUBv4NELXrUCpgGaAEhEBk1zrIYWKAnuVQ5z 1kwURoRUN1SvBNkTEglBxbLR3XK7qw9YpgvZ9AzOkPZmVoYIg4Vyp7yZIM6C+Mj+8Zt+ 262A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=OVFfxsfUxJFZiqwJsIdPxjw6niT0Wd62vvSC3Vd6CQA=; b=fC4vVMbjx1zFPDHV1hMR8gc0aFXo8DhkOl6NDhcnJzAaE7JSjxa6dnu9n5HDg/sbb1 ccHdSlLTU7KFLtZaGMTgxv++zuSV/wSGntUAsrAjyYVR/CNjyU0Y6fNPTXGRIdeUn02p uI4Tn51/Do7hSlMDNN+50p3QAQzhJCG4EAbiKmxTHYVHVZOMzT1Fab67awaSJIUPW2T0 gj9/PN71w5kUdqLz/zKJAQa6kznowLlUuvq491iWMa7BimOh4O0zkqmvSLoqm6YHS0xi q5gRZCJ2pQBv6noEiM0laqQlvMUCDlIAdUk98uDX14/x+TQxYlP01/6zxZwQfW9WsmbD F8zQ== X-Gm-Message-State: AOAM530R94FQrjVdjSULtYJhdmDAiIqMvr9QOrIAvq/CV4w9urCZOz9c smdJdOOtYu5I/fbEfIFwF4lmgA== X-Google-Smtp-Source: ABdhPJzBccNKe0Y469rICc++80NOL6S4tybo+rIVRTDwtvSZqJ+Wadwt8qIi9d6ryzQf9Q60rZEd7Q== X-Received: by 2002:a37:7844:: with SMTP id t65mr9639322qkc.429.1624026472443; Fri, 18 Jun 2021 07:27:52 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.95]) by smtp.gmail.com with ESMTPSA id w28sm5582349qtt.88.2021.06.18.07.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 07:27:51 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 095942A0ADA; Fri, 18 Jun 2021 10:27:50 -0400 (-04) Date: Fri, 18 Jun 2021 10:27:50 -0400 From: Alvaro Herrera To: Boris Kolpackov Cc: Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: Add version macro to libpq-fe.h Message-ID: <202106181427.xzfr43ceuwq5@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Jun-18, Boris Kolpackov wrote: > 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. But we do not add that many significant features to libpq in the first place, so I'm not sure it would be too bad. As far as I am aware, this is the first time someone has requested a mechanism to detect feature presence specifically in libpq. To put a number to it, I counted the number of commits to exports.txt since Jan 2015 -- there are 17. But many of them are just intra-release fixups; the number of actual "features" is 11, an average of two per year. That seems small enough to me. So I'm +1 on adding this "feature macro". (The so-version major changed from 4 to 5 in commit 1e7bb2da573e, dated April 2006.) > 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. Yeah, this one was added by commit cb92703384e2 on June 8th, three weeks after beta1. -- Álvaro Herrera Valdivia, Chile "Pido que me den el Nobel por razones humanitarias" (Nicanor Parra)