Re: Call EndCopyFrom() after initial table sync in logical replication - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Call EndCopyFrom() after initial table sync in logical replication
Date
Msg-id CAHGQGwHfdbfRRVdQjYRZmT94UMqE1W4MENiaseVtsHWmzkWxBQ@mail.gmail.com
Whole thread
In response to Re: Call EndCopyFrom() after initial table sync in logical replication  ("cca5507" <cca5507@qq.com>)
Responses Re: Call EndCopyFrom() after initial table sync in logical replication
Re: Call EndCopyFrom() after initial table sync in logical replication
List pgsql-hackers
On Fri, May 8, 2026 at 11:34 AM cca5507 <cca5507@qq.com> wrote:
>
> Hi,
>
> Maybe we want to add "free_parsestate(pstate);" after the "EndCopyFrom()" as well?

What actual issue could occur if free_parsestate() is not called there?

Since pstate->p_target_relation does not seem to be used afterward,
omitting free_parsestate() appears mostly harmless to me. Bascailly
calling free_parsestate() after make_parsestate() seems intuitive,
but from a quick grep I found several places that call make_parsestate()
without a corresponding free_parsestate().

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Broken build on macOS (Universal / Intel): cpuid instruction not available
Next
From: Chao Li
Date:
Subject: Fix REPACK with WITHOUT OVERLAPS replica identity indexes