Search Postgresql Archives

Re: Syntax error when combining --set and --command has me stumped

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

 



On 7/29/22 04:05, Gianni Ceccarelli wrote:
If you can use bash, or set up some redirections from whatever you're
using to execute ``psql``, you can do::

   $ psql somedb --set num=42 <<<'select :num'
   Timing is on.
   Expanded display is used automatically.
   Line style is unicode.
   Border style is 2.
   ┌──────────┐
   │ ?column? │
   ├──────────┤
   │       42 │
   └──────────┘
   (1 row)

   Time: 0.517 ms

or (more classically)::

   echo 'select :num' | psql somedb --set num=42

Since my process uses the same variable in multiple bash statements, I decided to use a bash environment variable.

--
Angular momentum makes the world go 'round.





[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