pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed[PATCH] Remove dead code in pg_dump
3+ messages / 3 participants
[nested] [flat]
* [PATCH] Remove dead code in pg_dump
@ 2026-09-01 14:32 Aleksander Alekseev <aleksander@tigerdata.com>
0 siblings, 1 reply; 3+ messages in thread
From: Aleksander Alekseev @ 2026-09-01 14:32 UTC (permalink / raw)
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Hi,
I found another couple of fields that are assigned but never read.
Looks like leftovers of 0ed707e9b7e and d8c05aff56b both from 2016.
Here is the patch.
--
Best regards,
Aleksander Alekseev
Attachments:
v1-0001-pg_dump-remove-write-only-TableInfo.numTriggers-a.patch (text/x-patch, 1.6K) download
From 1c598302cfcce9a9cebed6325b5c9341063b6e75 Mon Sep 17 00:00:00 2001
From: Aleksander Alekseev <aleksander@tigerdata.com>
Date: Tue, 1 Sep 2026 17:22:17 +0300
Subject: [PATCH v1] pg_dump: remove write-only TableInfo.numTriggers and
.triggers
Both fields are assigned in getTriggers() but never read. Remove them.
Author: Aleksander Alekseev <aleksander@tigerdata.com>
Reviewed-by: TODO FIXME
Discussion: TODO FIXME
---
src/bin/pg_dump/pg_dump.c | 4 ----
src/bin/pg_dump/pg_dump.h | 2 --
2 files changed, 6 deletions(-)
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index db14834e430..8c36c630d77 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -8796,10 +8796,6 @@ getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
if (curtblindx >= numTables)
pg_fatal("unrecognized table OID %u", tgrelid);
- /* Save data for this table */
- tbinfo->triggers = tginfo + j;
- tbinfo->numTriggers = numtrigs;
-
for (int c = 0; c < numtrigs; c++, j++)
{
tginfo[j].dobj.objType = DO_TRIGGER;
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index e6eefa98460..2bbb5d5773b 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -388,8 +388,6 @@ typedef struct _tableInfo
int numIndexes; /* number of indexes */
struct _indxInfo *indexes; /* indexes */
struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */
- int numTriggers; /* number of triggers for table */
- struct _triggerInfo *triggers; /* array of TriggerInfo structs */
} TableInfo;
typedef struct _tableAttachInfo
--
2.43.0
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [PATCH] Remove dead code in pg_dump
@ 2026-09-01 15:31 Japin Li <japinli@hotmail.com>
parent: Aleksander Alekseev <aleksander@tigerdata.com>
0 siblings, 1 reply; 3+ messages in thread
From: Japin Li @ 2026-09-01 15:31 UTC (permalink / raw)
To: Aleksander Alekseev <aleksander@tigerdata.com>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Hi, Aleksander
On Tue, 01 Sep 2026 at 17:32, Aleksander Alekseev <aleksander@tigerdata.com> wrote:
> Hi,
>
> I found another couple of fields that are assigned but never read.
> Looks like leftovers of 0ed707e9b7e and d8c05aff56b both from 2016.
> Here is the patch.
>
Nice catch. LGTM.
--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [PATCH] Remove dead code in pg_dump
@ 2026-09-01 16:26 Nathan Bossart <nathandbossart@gmail.com>
parent: Japin Li <japinli@hotmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Nathan Bossart @ 2026-09-01 16:26 UTC (permalink / raw)
To: Japin Li <japinli@hotmail.com>; +Cc: Aleksander Alekseev <aleksander@tigerdata.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Committed.
--
nathan
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2026-09-01 16:26 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-01 14:32 [PATCH] Remove dead code in pg_dump Aleksander Alekseev <aleksander@tigerdata.com>
2026-09-01 15:31 ` Japin Li <japinli@hotmail.com>
2026-09-01 16:26 ` Nathan Bossart <nathandbossart@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox