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

Поиск
Список
Период
Сортировка
Искать
От
Gianni Ceccarelli
Тема
Re: Syntax error when combining --set and --command has me stumped
Дата
Msg-id
20220729100518.6a8f819e@nautilus
Ответ на
Список
Дерево обсуждения
Syntax error when combining --set and --command has me stumped Ron <ronljohnsonjr@gmail.com>
Re: Syntax error when combining --set and --command has me stumped Adrian Klaver <adrian.klaver@aklaver.com>
Re: Syntax error when combining --set and --command has me stumped "David G. Johnston" <david.g.johnston@gmail.com>
Re: Syntax error when combining --set and --command has me stumped Ron <ronljohnsonjr@gmail.com>
Re: Syntax error when combining --set and --command has me stumped Gianni Ceccarelli <dakkar@thenautilus.net>
Re: Syntax error when combining --set and --command has me stumped Ron <ronljohnsonjr@gmail.com>
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

-- 
	Dakkar - 
	GPG public key fingerprint = A071 E618 DD2C 5901 9574
	                             6FE2 40EA 9883 7519 3F88
	                    key id = 0x75193F88



В списке pgsql-general по дате отправления
От: Lahnov, Igor
Дата:
FAQ