How to mix psql commands and SQL commands on the shell command line?

Поиск
Список
Период
Сортировка
От Aleksey Tsalolikhin
Тема How to mix psql commands and SQL commands on the shell command line?
Дата
Msg-id CA+jMWocnYb_Lpw+cx12ZwNASFR9EwCeGsOwFNLhH-1YchVZ13w@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to mix psql commands and SQL commands on the shell command line?  (Adrian Klaver <adrian.klaver@gmail.com>)
Re: How to mix psql commands and SQL commands on the shell command line?  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: How to mix psql commands and SQL commands on the shell command line?  (Aleksey Tsalolikhin <atsaloli.tech@gmail.com>)
Список pgsql-general
How can I mix psql commands and SQL commands on the shell command line, please?

$ psql
psql (9.2.1)
Type "help" for help.

ddcKeyGen=> \timing \\ select count(*) from auth_users;
Timing is on.
 count
-------
   276
(1 row)

Time: 1.730 ms

$ psql -c "\timing \\ select count(*) from auth_users;"
Timing is on.
$

It seems like psql discards everything after the first psql
argument...  Is there another way to mix psql and SQL commands on the
shell command line?

Best,
Aleksey


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: logs encoding problem Windows
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: How to mix psql commands and SQL commands on the shell command line?