PSQL commands: \quit_if, \quit_unless
От | Corey Huinker |
---|---|
Тема | PSQL commands: \quit_if, \quit_unless |
Дата | |
Msg-id | CADkLM=cx+xZTNdzi6r8Ax-G9OT04QGPmtMxo9Wzf2KMsyEJUAQ@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: PSQL commands: \quit_if, \quit_unless
|
Список | pgsql-hackers |
This patch adds two very simple psql commands: \quit_if and \quit_unless.
Each takes an optional string parameter and evaluates it for truthiness via ParseVariableBool().
If a true-ish value is passed to \quit_if, psql will behave as if the user had input \quit.
\quit_unless will do nothing if the value given was true-ish, and will \quit in any other circumstances.
Examples below show the behavior:
psql (10devel)
Type "help" for help.
# \quit_if
# \quit_unless
$ psql postgres
psql (10devel)
Type "help" for help.
# \quit_if f
# \quit_if 0
# \quit_if false
# \quit_if 2
unrecognized value "2" for "\quit_if"; assuming "on"
$ psql postgres
psql (10devel)
Type "help" for help.
# \quit_unless 2
unrecognized value "2" for "\quit_unless"; assuming "on"
# \quit_unless f
$
Вложения
В списке pgsql-hackers по дате отправления: