Determine server version from psql script

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Determine server version from psql script
Date: 2025-03-23 00:31:45
Message-ID: CA+FnnTyWEsYi=_QTeSXoGXd7Fkd8C7_AnCc5=hho-DZF9_iunQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, All,
I have a big script that populated the DB for me.

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?

Thank you.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-03-23 00:42:43 Re: Determine server version from psql script
Previous Message Tom Lane 2025-03-22 22:55:08 Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000