Re: BeginCopyTo - remove switching to old memory context in between COPY TO command processing - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: BeginCopyTo - remove switching to old memory context in between COPY TO command processing
Date
Msg-id YfPSTZy4HnrMrYBm@paquier.xyz
Whole thread Raw
In response to BeginCopyTo - remove switching to old memory context in between COPY TO command processing  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Fri, Jan 28, 2022 at 03:41:11PM +0530, Bharath Rupireddy wrote:
> While reviewing patch at [1], it has been found that the memory
> context switch to oldcontext from cstate->copycontext in between
> BeginCopyTo is not correct because the intention of the copycontext is
> to use it through the copy command processing. It looks like a thinko
> from the commit c532d1 [2]. Attaching a small patch to remove this.
>
> Thoughts?

I think that you are right.  Before c532d15d, BeginCopy() was
internally doing one switch with copycontext and the current memory
context.  This commit has just moved the internals of BeginCopy()
into BeginCopyTo(), so this looks like a copy-paste error to me.  I'll
go fix it, thanks for the report!
-
Michael

Attachment

pgsql-hackers by date:

Previous
From: Japin Li
Date:
Subject: Re: BeginCopyTo - remove switching to old memory context in between COPY TO command processing
Next
From: Fabrice Chapuis
Date:
Subject: Re: Logical replication timeout problem