Search Postgresql Archives

How to assign default values to psql variables?

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

 



Hi,

I have a psql script relying on variables passed in on the command line with -v.

Is there any way to assign a default value in case the -v option is forgotten?

Here is an example with pgtap:

select diag('should be printed only in verbose mode') where :testverbose;

This can be called with -v testverbose=true or -v testverbose=false. However, if the assignment is forgotten, it breaks. I'd like to behave it as if testverbose=false was passed.

Thanks.

[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 Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux