Re: [HACKERS] PSQL commands: \quit_if, \quit_unless

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] PSQL commands: \quit_if, \quit_unless
Дата
Msg-id 12343.1484371346@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] PSQL commands: \quit_if, \quit_unless  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: [HACKERS] PSQL commands: \quit_if, \quit_unless  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: [HACKERS] PSQL commands: \quit_if, \quit_unless  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Re: [HACKERS] PSQL commands: \quit_if, \quit_unless  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2017-01-14 0:20 GMT+01:00 Corey Huinker <corey.huinker@gmail.com>:
>> - leaving loops out for now?

> +1

I'm just going to say one thing about that: some people will remember
that you can build a Turing machine with either conditionals+iteration
or conditionals+recursion.  I wonder what depth of include-file nesting
psql can support, or whether we'll be able to fix it to optimize tail
recursion of an include file.  Because somebody will be asking for that
if this is the toolset you give them.
        regards, tom lane

PS: if I'm being too obscure for you, consider:

$ cat loop.sql
\if :x < 1000 \echo :x \set x :x + 1 \include loop.sql
\fi
$ psql --set x=0 -f loop.sql

Somebody is going to think of that workaround for not having loops, and
then whine about how psql runs out of file descriptors and/or stack.



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [HACKERS] how to correctly invalidate a constraint?
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: [HACKERS] PSQL commands: \quit_if, \quit_unless