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

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: BUG #5448: psql \set does not terminate if variable is referenced recursively
Дата
Msg-id hs64gr$1hm$3@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на BUG #5448: psql \set does not terminate if variable is referenced recursively  ("Francis" <fmarkham@gmail.com>)
Список pgsql-bugs
On 2010-05-05, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> The problem is there's no real support inside psql for "throwing an
> error" --- we have to unwind all the state manually.  In particular,
> what this problem requires is backing out the stack of flex buffers
> representing pending variable expansions.  So I think we need to add
> an explicit recursion test and suppress further expansion of the
> variable when we see it, but there's no very simple way to just abandon
> the current command altogether.

having not examined the code I immagine something like this could work.

fputs(stgerr,"recursive expansion\n");
raise(SIGINT);
return "";

> We can definitely print a message though, and I agree that just silently
> suppressing recursion would be confusing.

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

Предыдущее
От: bryanh@giraffe-data.com (Bryan Henderson)
Дата:
Сообщение: bool: symbol name collision
Следующее
От: Tom Lane
Дата:
Сообщение: Re: bool: symbol name collision