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 1luIzP-0006sv-F4 for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jun 2021 18:13:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1luIzO-0001Od-G3 for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jun 2021 18:13:10 +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 1luIqJ-0000pd-R0 for pgsql-hackers@lists.postgresql.org; Fri, 18 Jun 2021 18:03:47 +0000 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1luIqH-0000hY-LZ for pgsql-hackers@lists.postgresql.org; Fri, 18 Jun 2021 18:03:47 +0000 Received: by mail-qt1-x82f.google.com with SMTP id o19so8187814qtp.5 for ; Fri, 18 Jun 2021 11:03:45 -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=AC7P+QMcCfVBCAxIyJyuon82PazkHrCSjG4L7WlJZbw=; b=t39srJ3CnmRaTP+TFa0X1ZwjjfX7JoFn89S4bcG0efS5ccbwYYfudQIOcBjbveby1f u6c1C8UKJDu87qyX6LBPQzfHCen6iIfgIh+QcUrBJ8Nf0lF8S2wIClxqhwKggneQFZSB FK0cT45cb3Rc9oW+EgwfuC8EL/SabUaY/WpxWRTaiwpxQqreqFZq8Q7Wae2pq7xDf1cV vgbOtO+fs60N4ngMSicn3rjoPgOP1KXRBkCKtEKVoisZ5CFFogk0iTf03kAyURT+7imA N3uGziCoGbWjVNSud5O4xnizVb12QS8V9h+5fy8yReQ+q97kPwmixqV++o7GwY8wKyQg QiEQ== 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=AC7P+QMcCfVBCAxIyJyuon82PazkHrCSjG4L7WlJZbw=; b=a56WEu2kE/Pm5Q99HgMo7g96e992NziijecZD+TnYwpG96WJaSV7G7LaOgyUwsWP/Q +LHXowUgPUjr815NzsH1brx+tFYejo5LY6WneQB3kCy+wGY7FkSeZFUrH2izESX88LeJ HLT9tcLkpTO1pd0XqVSJ84asK5tfVsc23tLjZzodo0Tt267yP905GWCnHqiwCpmC2KMQ hBtegDRy30GEDT5saoSXtv1noiACFpqebhVeMopuOQBktyWgfAvm5ZIsjvEchZLtAWNG nYEzSd0MCWdPEdMq7U/l89K4kpAOnUmy8s22higIEsSMTOZO2ljyDOPyi5ODtsu9W0Re ydNg== X-Gm-Message-State: AOAM532NCH1EBb47hE/V/GgSY2tlr+xlHWsl/u7pWr3GYLfsUVkw1cRw roCCzx412LKoUrDTxuJYXgjZmw== X-Google-Smtp-Source: ABdhPJwcMdHUCZaThINkDd9CrqOXiypxV9O1x+qQDsLn5W4AJhkYCp/6kffR9QkJJPfvVl34gh5Lew== X-Received: by 2002:ac8:4e2e:: with SMTP id d14mr11817997qtw.205.1624039423830; Fri, 18 Jun 2021 11:03:43 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.95]) by smtp.gmail.com with ESMTPSA id o66sm4711105qkd.60.2021.06.18.11.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 11:03:43 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9CFFE2A0ADA; Fri, 18 Jun 2021 14:03:41 -0400 (-04) Date: Fri, 18 Jun 2021 14:03:41 -0400 From: Alvaro Herrera To: Tom Lane Cc: Boris Kolpackov , pgsql-hackers@lists.postgresql.org Subject: Re: Add version macro to libpq-fe.h Message-ID: <202106181803.7ueuxvqv5jah@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1231631.1624038273@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Jun-18, Tom Lane wrote: > Alvaro Herrera writes: > > So I'm +1 on adding this "feature macro". > > Concretely, how about the attached? Seems OK to me. We can just accumulate any similar ones in the future nearby. > (I also got rid of a recently-added > extra comma. While the compilers we use might not warn about that, > it seems unwise to assume that no user's compiler will.) Oops. > I guess one unresolved question is whether we want to mention these in > the SGML docs. I vote "no", because it'll raise the maintenance cost > noticeably. But I can see an argument on the other side. Well, if we do want docs for these macros, then IMO it'd be okay to have them in libpq-fe.h itself rather than SGML. A one-line comment for each would suffice: +/* + * These symbols may be used in compile-time #ifdef tests for the availability + * of newer libpq features. + */ +/* Indicates presence of PQenterPipelineMode and friends */ +#define LIBPQ_HAS_PIPELINING 1 + +/* Indicates presence of PQsetTraceFlags; PQtrace changed output format */ +#define LIBPQ_HAS_TRACE_FLAGS 1 -- Álvaro Herrera 39°49'30"S 73°17'W