public inbox for [email protected]
help / color / mirror / Atom feedFrom: Aleksander Alekseev <[email protected]>
To: PostgreSQL Development <[email protected]>
Subject: [PATCH] Remove dead code in ExecForPortionOfLeftovers()
Date: Tue, 21 Apr 2026 15:22:29 +0300
Message-ID: <CAJ7c6TN9ETkTxdcwuexovXrXdpNWcxzQ7iiTes+_xpEWC5xO0Q@mail.gmail.com> (raw)
Hi,
While reading 8e72d914c528 I noticed that
ForPortionOfState.fp_leftoverstypcache is not used for anything. I
suggest removing it, as attached.
--
Best regards,
Aleksander Alekseev
Attachments:
[text/x-patch] v1-0001-Remove-unused-ForPortionOfState.fp_leftoverstypca.patch (2.3K, 2-v1-0001-Remove-unused-ForPortionOfState.fp_leftoverstypca.patch)
download | inline diff:
From 2c7e1f434322ddbb7517b87773ef8c80307d1398 Mon Sep 17 00:00:00 2001
From: Aleksander Alekseev <[email protected]>
Date: Tue, 21 Apr 2026 15:11:13 +0300
Subject: [PATCH v1] Remove unused ForPortionOfState.fp_leftoverstypcache field
Oversight of commit 8e72d914c528.
Author: Aleksander Alekseev <[email protected]>
Reviewed-by: TODO FIXME
Discussion: TODO FIXME
---
src/backend/executor/nodeModifyTable.c | 13 -------------
src/include/nodes/execnodes.h | 1 -
2 files changed, 14 deletions(-)
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 4cb057ca4f9..6ee26d9803f 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -1411,7 +1411,6 @@ ExecForPortionOfLeftovers(ModifyTableContext *context,
ForPortionOfExpr *forPortionOf = (ForPortionOfExpr *) node->forPortionOf;
AttrNumber rangeAttno;
Datum oldRange;
- TypeCacheEntry *typcache;
ForPortionOfState *fpoState;
TupleTableSlot *oldtupleSlot;
TupleTableSlot *leftoverSlot;
@@ -1491,18 +1490,6 @@ ExecForPortionOfLeftovers(ModifyTableContext *context,
elog(ERROR, "found a NULL range in a temporal table");
oldRange = oldtupleSlot->tts_values[rangeAttno - 1];
- /*
- * Get the range's type cache entry. This is worth caching for the whole
- * UPDATE/DELETE as range functions do.
- */
-
- typcache = fpoState->fp_leftoverstypcache;
- if (typcache == NULL)
- {
- typcache = lookup_type_cache(forPortionOf->rangeType, 0);
- fpoState->fp_leftoverstypcache = typcache;
- }
-
/*
* Get the ranges to the left/right of the targeted range. We call a SETOF
* support function and insert as many temporal leftovers as it gives us.
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 13359180d25..db11e7042ea 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -480,7 +480,6 @@ typedef struct ForPortionOfState
Oid fp_rangeType; /* the type of the FOR PORTION OF expression */
int fp_rangeAttno; /* the attno of the range column */
Datum fp_targetRange; /* the range/multirange from FOR PORTION OF */
- TypeCacheEntry *fp_leftoverstypcache; /* type cache entry of the range */
TupleTableSlot *fp_Existing; /* slot to store old tuple */
TupleTableSlot *fp_Leftover; /* slot to store leftover */
} ForPortionOfState;
--
2.43.0
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH] Remove dead code in ExecForPortionOfLeftovers()
In-Reply-To: <CAJ7c6TN9ETkTxdcwuexovXrXdpNWcxzQ7iiTes+_xpEWC5xO0Q@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox