Re: alternative to PG_CATCH

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: alternative to PG_CATCH
Дата
Msg-id 25199.1572365431@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: alternative to PG_CATCH  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: alternative to PG_CATCH
Список pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 2019-10-28 13:45, Robert Haas wrote:
>> In theory, the do_rethrow variable could conflict with a symbol
>> declared in the surrounding scope, but that doesn't seem like it's a
>> problem worth getting worked up about.

> Right.  A PG_TRY block also declares other local variables for internal 
> use without much care about namespacing.  If it becomes a problem, it's 
> easy to address.

Although we haven't been terribly consistent about it, some of our macros
address this problem by using local variable names with a leading and/or
trailing underscore, or otherwise making them names you'd be quite
unlikely to use in normal code.  I suggest doing something similar
here.  (Wouldn't be a bad idea to make PG_TRY's variables follow suit.)

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Getting psql to redisplay command after \e
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Rearranging ALTER TABLE to avoid multi-operations bugs