Search Postgresql Archives

psql --command option ignores --variable's

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

 



Hi all,

It seems the behaviour of the —command / -c option is such that it will ignore any variables set on the command-line.


:~ psql --variable TESTVAR='123' --command 'select :TESTVAR;'
ERROR:  syntax error at or near ":"
LINE 1: select :TESTVAR;
               ^

:~$ psql --variable TESTVAR='123'
psql (9.1.9)
Type "help" for help.

timk=> select :TESTVAR;
 ?column?
----------
      123
(1 row)



Obviously, there are ways around this, but is this expected behaviour?


Tim

[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