| From: | Daniel Gustafsson <daniel(at)yesql(dot)se> |
|---|---|
| To: | 慈超云 <cichaoyun(at)halodbtech(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: [PATCH] Remove unused is_error parameter from TeardownHistoricSnapshot() |
| Date: | 2026-03-08 22:11:57 |
| Message-ID: | E7BBDE93-B347-4680-92DC-D9ABFC34418D@yesql.se |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On 6 Mar 2026, at 08:34, 慈超云 <cichaoyun(at)halodbtech(dot)com> wrote:
>
> Hi hackers,
>
> I found that the is_error parameter of the TeardownHistoricSnapshot() function is not actually used anywhere in the code.
> This parameter was introduced in commit
> b89e151054a05f0f6d356ca52e3b725dd0505e53 as part of the logical decoding feature, but has never been used. The function just sets two global pointers to NULL regardless of the parameter value.
It is indeed unused, but given that it exists and the callers set it
appropriately it could be a pretty valuable debugging aid when attaching, or
adding logging, to TeardownHistoricSnapshot. Compilers are smart enough to
take care of this for us so there seems to be little value in removing this
(apart from silencing AI tools but that's not something we optimize for).
--
Daniel Gustafsson
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ranier Vilela | 2026-03-08 23:05:06 | Avoid resource leak (src/bin/pg_dump/pg_dumpall.c) |
| Previous Message | Manni Wood | 2026-03-08 19:45:44 | Re: Speed up COPY FROM text/CSV parsing using SIMD |