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 1tw9gN-00BFrf-G9 for pgsql-general@arkaria.postgresql.org; Sun, 23 Mar 2025 00:59:19 +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 1tw9gL-0065BA-PS for pgsql-general@arkaria.postgresql.org; Sun, 23 Mar 2025 00:59:17 +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 1tw9gL-0065B2-At for pgsql-general@lists.postgresql.org; Sun, 23 Mar 2025 00:59:17 +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.96) (envelope-from ) id 1tw9gJ-000ai0-1p for pgsql-general@lists.postgresql.org; Sun, 23 Mar 2025 00:59:16 +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 52N0xBui460948; Sat, 22 Mar 2025 20:59:11 -0400 From: Tom Lane To: Adrian Klaver cc: Igor Korot , "pgsql-generallists.postgresql.org" Subject: Re: Determine server version from psql script In-reply-to: <90741d5f-5cda-4c4a-84f4-c470129732f4@aklaver.com> References: <90741d5f-5cda-4c4a-84f4-c470129732f4@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Sat, 22 Mar 2025 17:42:43 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <460946.1742691551.1@sss.pgh.pa.us> Date: Sat, 22 Mar 2025 20:59:11 -0400 Message-ID: <460947.1742691551@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > On 3/22/25 17:31, Igor Korot wrote: >> Is there a way to determine the server version from such a script? > show server_version_num; psql already populates its SERVER_VERSION_NUM variable from that for you. regards, tom lane