Search Postgresql Archives

Re: Determine server version from psql script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, David,

On Sat, Mar 22, 2025, 8:58 PM David G. Johnston <david.g.johnston@xxxxxxxxx> wrote:
On Saturday, March 22, 2025, Igor Korot <ikorot01@xxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux