public inbox for [email protected]  
help / color / mirror / Atom feed
From: Igor Korot <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Adrian Klaver <[email protected]>
Cc: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: Determine server version from psql script
Date: Sat, 22 Mar 2025 21:28:14 -0500
Message-ID: <CA+FnnTy2Lk+K8t2uKwc1cAnCm6+RTb72eVRxt9+Y8y+C=sUeyA@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwZGjMYbP0nWYb2+-D1a_dNg6b-mDhDC96Am-c2MZOYTNw@mail.gmail.com>
References: <CA+FnnTyWEsYi=_QTeSXoGXd7Fkd8C7_AnCc5=hho-DZF9_iunQ@mail.gmail.com>
	<[email protected]>
	<CA+FnnTz9-cjBDf3mC9fx_FCtZGDTneF9=w8LpTRdwCfxHN86yw@mail.gmail.com>
	<CAKFQuwZGjMYbP0nWYb2+-D1a_dNg6b-mDhDC96Am-c2MZOYTNw@mail.gmail.com>

Hi, David,

On Sat, Mar 22, 2025, 8:58 PM David G. Johnston <[email protected]>
wrote:

> On Saturday, March 22, 2025, Igor Korot <[email protected]> wrote:
>
>>
>>
>>> Is it actually running in psql?
>>>
>>
>> Yes, i run "psql - d draft -a -f <filename>
>>
>
> Then read the psql docs.  Your version has \if and you’ll find server
> version listed as the available client variables.
>

I was hoping for something like

If server_version >= X:
     CREATE OR REPLACE TRIGGER...
else:
     CREATE TRIGGER...

Python-like syntax here as I'm not sure how to do it properly...

Thank you.


> David J.
>
>


view thread (14+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Determine server version from psql script
  In-Reply-To: <CA+FnnTy2Lk+K8t2uKwc1cAnCm6+RTb72eVRxt9+Y8y+C=sUeyA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox