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 1twQyk-00EZiL-UF for pgsql-general@arkaria.postgresql.org; Sun, 23 Mar 2025 19:27:26 +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 1twQyj-004L6v-7a for pgsql-general@arkaria.postgresql.org; Sun, 23 Mar 2025 19:27:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1twQyi-004L6l-Sd for pgsql-general@lists.postgresql.org; Sun, 23 Mar 2025 19:27:24 +0000 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1twQyg-000j3U-1y for pgsql-general@lists.postgresql.org; Sun, 23 Mar 2025 19:27:24 +0000 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-5fc6cd89f85so2016042eaf.1 for ; Sun, 23 Mar 2025 12:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742758040; x=1743362840; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3WTo9Hzmna+2FTwBlCcDa1s2kNIxoFZlDl6O2uTqJfI=; b=GWxQQUr/iNCxNBd46gdZLW9oMz2ohDI2pBMMI9LDmCo1XvWwx480gQKtynCzXfMizO FZKZYKqLFLloMSwDdLqINL1kMPYAx0WwT7rt12/8O31AvjD5VRKbF5WmvpTWy71kwW0a fAC/85jCYFl7QXlEhoxUVMXhk/vLkhaCcj1H0l40H21imdyy+XdRxQqYEdxIpW2SZJOL idKYHWcw+64K1Ecr/Z89KCOmgmTsQGMz5qS+GG1lTq1eqMj0G3lTT+TsIy4OwQ+Esqoh tpSm78QNT8mwWvsCsSsPYhXBNJhJLylVhZQwXB8PJVdvIcxQFsx0HkgAoFZ4Lzg/7Lhn U9VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742758040; x=1743362840; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3WTo9Hzmna+2FTwBlCcDa1s2kNIxoFZlDl6O2uTqJfI=; b=Zg573FT/58CbMOROg/SOdch7DF33z3nBgs7+99HTcMJHAp3En/8NJZ3Jd38e8QT7sI /U0w0R5fsbPdGOQFYFXqxcL+hx7Mho9mB2tXrWLM86W0OjhZ0Y097nTMjn4eWzgyfIum 5AWmB6UidNlBEZSyPCNFAe6cG8qKqzaNTUiTB4PAyDOIf5kpeOUeXY2pWi3um3TQsL0V V8HtfoTpHxPta1tOKTJi0RPMTAqXqQqXls6MSjt2SiZU+aEyXhCDk/FZA0ywhQ3xgNcG O44BUdY4zBv7SiNj2KlEo0j62ET8sIbznAQcFBtMTEfoPWcMDQaOrxoblT4MdwN01I6Z rp7Q== X-Forwarded-Encrypted: i=1; AJvYcCVeqxVwAUoF4aJE/onJhSMtNCIH+ck7+PoXpOf9/I8KPiUp/17idQf+A1ut/21jwOstDw861TZ0L8OGcW4i@lists.postgresql.org X-Gm-Message-State: AOJu0Yw+iet0+OHvUTxLGcdJW+Yufff7JP7SJr3fvh6Ur5kRwHg1aZpE JuJvqn4bogxkzU1INu4cL/jZxsPPEzsRh6zXIPaNBYTBlCQD/LzT/hc6+/bSUWHEJuCj1NweQXJ 20htze3QsMO3bUlWVngfWmCErU7w= X-Gm-Gg: ASbGncv8vOiG+qzz1u0DXOvoxOWTws1EZs13Hu6Id0JCLdKdzkr6YlXmEmhn7eXZgok +I1TNmhjQKqcrAL+kaUAQ/1HeF16igxmFqWt3XG8wmBdvqPr4hrMU/iHpmilLm2oHIv3aV4veOE NG3WDrPi0EuyusTl6VJ26Ww+usIsqb0nbBsfY= X-Google-Smtp-Source: AGHT+IFUBzfAiMz5W2KaMvac47ibelrJ/Tr2T2y8qLSQi+WCXjiPRbNi7GgehN6VDODSWxpEXxGPXqQyrN1Q3Ot1yow= X-Received: by 2002:a05:6870:9a8d:b0:29e:3c90:148b with SMTP id 586e51a60fabf-2c78049eaf4mr7002548fac.26.1742758040399; Sun, 23 Mar 2025 12:27:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:349:0:b0:589:13f9:e937 with HTTP; Sun, 23 Mar 2025 12:27:19 -0700 (PDT) In-Reply-To: References: <90741d5f-5cda-4c4a-84f4-c470129732f4@aklaver.com> <473602.1742698901@sss.pgh.pa.us> From: "David G. Johnston" Date: Sun, 23 Mar 2025 12:27:19 -0700 X-Gm-Features: AQ5f1Jq4Do5y0YINA1skj5FZPRX6Vaxz8t3qHzDI8VUa4dKuaDU-9gsrK7CoKy8 Message-ID: Subject: Re: Determine server version from psql script To: Pavel Stehule Cc: Igor Korot , Tom Lane , Adrian Klaver , "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000ed781706310779e4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ed781706310779e4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, March 23, 2025, Pavel Stehule wrote: > Hi > > ne 23. 3. 2025 v 19:31 odes=C3=ADlatel Igor Korot na= psal: > >> Hi, >> >> [code] >> SELECT current_setting('server_version_num')::int > 130000 as v13 >> > > SELECT current_setting('server_version_num')::int > =3D140000 as v14 > IOW, you can=E2=80=99t use >130000 because that will match v13.1 which is 1= 30001 in integer format. David J. --000000000000ed781706310779e4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, March 23, 2025, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hi

ne 23. 3. 2025 v=C2=A019:31 odes=C3=ADla= tel Igor Korot <= ikorot01@gmail.com> napsal:
Hi,

[code]
SELECT current_setting('server_version_num')::int > 130000 = as v13
=C2=A0
SELEC= T current_setting('server_version_num')::int > =3D140000 as= v14

IOW, you can=E2=80= =99t use >130000 because that will match v13.1 which is 130001 in intege= r format.

David J.

--000000000000ed781706310779e4--