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 1twAQt-00BNA4-1h for pgsql-general@arkaria.postgresql.org; Sun, 23 Mar 2025 01:47:23 +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 1twAQq-006r20-Bj for pgsql-general@arkaria.postgresql.org; Sun, 23 Mar 2025 01:47:20 +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 1twAQq-006r1r-0y for pgsql-general@lists.postgresql.org; Sun, 23 Mar 2025 01:47:20 +0000 Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1twAQo-000b0U-0a for pgsql-general@lists.postgresql.org; Sun, 23 Mar 2025 01:47:19 +0000 Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-6f7031ea11cso33153757b3.2 for ; Sat, 22 Mar 2025 18:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742694437; x=1743299237; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XsxzBfIEZdULA4ZRYBHXAhKgSnYGlUDDGo7mEZuzDPY=; b=eCLjUSblsMT6zkMW1bfr7rh40k1WTvh5MIMv3lsvHT3JQv+ZHScteTwEy7NBAwnr0q rear1vZV7yGhdi84lqSzcOco1p8Rjwz4Ql0Q+oGw0a1p2DM0dRUZBlPkAcyrCshY5P8H CSRAAQrCjw/Lf/6bVrMVqm+wdyrytxbMgkipCVzJ3d95aB29wS0YW9oZ2yHHvBut/I7Q KE8NwpounwSMOfgmVM25VY6tQPcDxybnQaOF6jvVejFBpVFyBlR1aUtbbjb/A/4i1hrY A/yDV2o7Hl36r4Pnq0yosf6+wNBrPFUpQahVi0f/8SDtx0Y0SIGHqWmoKfhYfjV1T7n1 39yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742694437; x=1743299237; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XsxzBfIEZdULA4ZRYBHXAhKgSnYGlUDDGo7mEZuzDPY=; b=nMpF/Ver7LKBelit6Zqi64CCbEaNEvuLiU/8wCxR+yMOFyB0CPyX/sBZXpT59P4ir5 dBp3w32ROxvRTdLqquvvyhTprbwBOxpoIE0SJpyfbUdk36v6Dv3VaQZ/dsuuk0KDY4MJ yOH8kkQU5Z5MwItIo9tpyPm8pLBoQ+fI53czO1fJUnQsMgGb260Shl8DN1WKI46q5iDt 6/pVWTdM1uw9+6u4lxuvF3Ro13C4yKDWahmffpEiM0osA312cnYbEXY2620g5qAaLiZp fecKL6ZuVHc4s9GneCIhuTd3BisGircltsU0vPzM2Csaas0sh2jfwc4Iq16WESQrucse a9IQ== X-Gm-Message-State: AOJu0YwscJKz5Dk8HEPet/KYl1G5uoaqy/BB3bSmZt4EJMWIwuKgbOaj n8ZQT2UCgxe9NZ4eo2yi5vhfkHUppMSy8NB5dhjGAKDwOifDkQa0vwbF7ZBD7dcns4DeIQfFZQx gmmX9r4Yd7638oGB0lhnEXwxY2tc= X-Gm-Gg: ASbGncsx97Qtp6tXJaThJThI3U8ceQrMgipSRoSyJ9ZB/QyZ83igvvV0Y3AlJa0pU0k VxsqmLGxQqH3qa3cQ7DkKDDGfAJpc5WeXpaRfWpRyNT2TIfkmwqEclE6600FNOkaVGg7EcYjDKt 7duL2MyG4wZWrIkLgayxNi5TE2WIL1sGRFVE+20xFVjn+KFa/Vm8DPxAfFSeUc/mfrEQI8u+4= X-Google-Smtp-Source: AGHT+IFtCY02gXjDyO7/1YOnk3kc9QzqKe9gngCiKaVoCMXHJ5cMRMxdS4ER4IVfFEbB2bvu+KrzqVMdLJ7Zw2UxSZg= X-Received: by 2002:a05:690c:6384:b0:6fe:c803:b48e with SMTP id 00721157ae682-700bac7c4c9mr100733737b3.22.1742694436893; Sat, 22 Mar 2025 18:47:16 -0700 (PDT) MIME-Version: 1.0 References: <90741d5f-5cda-4c4a-84f4-c470129732f4@aklaver.com> In-Reply-To: <90741d5f-5cda-4c4a-84f4-c470129732f4@aklaver.com> From: Igor Korot Date: Sat, 22 Mar 2025 20:47:05 -0500 X-Gm-Features: AQ5f1JpkE35IGczD8obXJ820jYxyPbez5PzmMDMxMNj_wV0SpCFjZpKIUKN467w Message-ID: Subject: Re: Determine server version from psql script To: Adrian Klaver Cc: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000dcfccd0630f8aa4f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000dcfccd0630f8aa4f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Adrian, On Sat, Mar 22, 2025, 7:42=E2=80=AFPM Adrian Klaver wrote: > On 3/22/25 17:31, Igor Korot wrote: > > Hi, All, > > I have a big script that populated the DB for me. > > The language used for the script? > What do you mean? Its just a text file with bunch of create table/insert into > Is it actually running in psql? > Yes, i run "psql - d draft -a -f > > > > I made it based on the latest available version. > > > > However, i have version 13 installed on my Linux box and so trying to > > execute "CREATE OR REPLACE TRIGGER..." will fail. > > > > Is there a way to determine the server version from such a script? > > From here: > > > https://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-SERVER-= VERSION-NUM > > show server_version_num; > > Though how you use that is going to depend on the answers to the first > two questions. > > > > > Thank you. > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > --000000000000dcfccd0630f8aa4f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, Adrian,

On Sat, Mar 22, 2025,= 7:42=E2=80=AFPM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 3/22/25 17:31, Igor Korot wrote:
> Hi, All,
> I have a big script that populated the DB for me.

The language used for the script?

What do you mean?
I= ts just a text file with bunch of create table/insert into


Is it actually running in psql?

Yes, i run "psql - d draft -a -f <fi= lename>



>
> I made it based on the latest available version.
>
> However,=C2=A0 i have version 13 installed on my Linux box and so tryi= ng to
> execute "CREATE OR REPLACE TRIGGER..." will fail.
>
> Is there a way to determine the server version from such a script?

=C2=A0From here:

https= ://www.postgresql.org/docs/13/runtime-config-preset.html#GUC-SERVER-VERSION= -NUM

show server_version_num;

Though how you use that is going to depend on the answers to the first
two questions.

>
> Thank you.
>

--
Adrian Klaver
adrian.klaver@aklaver.com

--000000000000dcfccd0630f8aa4f--