Re: BUG #5448: psql \set does not terminate if variable is referenced recursively

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: BUG #5448: psql \set does not terminate if variable is referenced recursively
Дата
Msg-id 4BE14E6102000025000312DF@gw.wicourts.gov
обсуждение исходный текст
Ответ на BUG #5448: psql \set does not terminate if variable is referenced recursively  ("Francis" <fmarkham@gmail.com>)
Ответы Re: BUG #5448: psql \set does not terminate if variable is referenced recursively  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
"Francis" <fmarkham@gmail.com> wrote:

> psql \set does not terminate if a variable is referenced
> recursively.  For example, the following will hang the psql client
> in a nasty way:
>
> db=# \set n 1
> db=# \set n (:n + 1)

It seem to me that the above doesn't hang the psql client, but a
subsequent reference to :n does.  It doesn't have to be a direct
self-reference, either; any circular reference seems to do it.  It
doesn't respond to Ctrl+C during this recursion.

pgbench=# \set n 1
pgbench=# \set x (:n+1)
pgbench=# select :x;
 ?column?
----------
        2
(1 row)

pgbench=# \set n 5
pgbench=# select :x;
 ?column?
----------
        6
(1 row)

pgbench=# \set n (:x+1)
pgbench=# select :x;
[CAUTION: psql sucked CPU time and ate RAM until I killed it]

-Kevin

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #5449: "elements" are not parameter
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5448: psql \set does not terminate if variable is referenced recursively