Re: chained transactions

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: chained transactions
Дата
Msg-id db51c67a-3747-8a01-4a74-49b22aefb32d@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: chained transactions  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On 2019-02-16 06:22, Andres Freund wrote:
>> +static int    save_XactIsoLevel;
>> +static bool    save_XactReadOnly;
>> +static bool    save_XactDeferrable;
> 
> We normally don't define variables in the middle of a file?  Also, why
> do these need to be global vars rather than defined where we do
> chaining? I'm imagining a SavedTransactionState struct declared on the
> stack that's then passed to Save/Restore?
> 
> Not crucial, but I do wonder if we can come up with a prettier approach
> for this.

If we do it with a struct that is passed to the functions, then either
the struct contents will be available outside of xact.c, which will
expose internals of xact.c that weren't previously exposed, or we do it
with an incomplete struct, but then this would involve palloc across
transaction commit, resulting in additional complexity.  Neither of
these sound like obviously better alternatives.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: chained transactions
Следующее
От: Rafia Sabih
Дата:
Сообщение: Re: explain plans with information about (modified) gucs