Search Postgresql Archives

Re: psql scripting tutorials

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

 



In article <Pine.GSO.4.64.0809110111250.244@xxxxxxxxxxx>,
Greg Smith <gsmith@xxxxxxxxxxxxx> writes:

> On Tue, 9 Sep 2008, Artacus wrote:
>> Can psql access environmental variables or command line params?

> $ cat test.sql
> select :TEST as "input";
> $ psql -v TEST=16 -f test.sql
>  input
> -------
>     16
> (1 row)

Nice trick, but when I try the following variant:

  psql -v TEST=16 -c 'select :TEST as "input"'

I get

  ERROR:  syntax error at or near ":"
  LINE 1: select :TEST as "input"

This seems to be contrary to the psql manual page:

 These assignments are done during a very early stage of start-up...



[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