Re: Remove redundant MemoryContextSwith in BeginCopyFrom

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Remove redundant MemoryContextSwith in BeginCopyFrom
Дата
Msg-id 539760.1642610324@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Remove redundant MemoryContextSwith in BeginCopyFrom  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Remove redundant MemoryContextSwith in BeginCopyFrom  (Japin Li <japinli@hotmail.com>)
Список pgsql-hackers
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> writes:
> +1. It looks like a thinko from c532d15d. There's no code in between,
> so switching to oldcontext doesn't make sense.

Agreed.

> I think we also need to remove MemoryContextSwitchTo(oldcontext); at
> the end of BeginCopyTo in copyto.c, because we are not changing memory
> contexts in between.

Hmm, I think it'd be a better idea to remove the one in the middle of
BeginCopyTo.  The code after that is still doing setup of the cstate,
so the early switch back looks to me like trouble waiting to happen.

            regards, tom lane



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

Предыдущее
От: tushar
Дата:
Сообщение: Re: refactoring basebackup.c
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Replace uses of deprecated Python module distutils.sysconfig