Re: Determine server version from psql script - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Determine server version from psql script
Date
Msg-id 90741d5f-5cda-4c4a-84f4-c470129732f4@aklaver.com
Whole thread Raw
In response to Determine server version from psql script  (Igor Korot <ikorot01@gmail.com>)
Responses Re: Determine server version from psql script
Re: Determine server version from psql script
List pgsql-general
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?

Is it actually running in psql?

> 
> 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




pgsql-general by date:

Previous
From: Igor Korot
Date:
Subject: Determine server version from psql script
Next
From: Tom Lane
Date:
Subject: Re: Determine server version from psql script