postgres.git / summary / log / commit / refs
commit 89f059bdf52cc9a86b890d42ceed92237123479e
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Wed Jan 19 17:31:15 2022 +0000
Remove redundant memory context switches in BeginCopyFrom().
This is probably a leftover from code refactoring.
Japin Li
Discussion: https://postgr.es/m/MEYP282MB16693DDABDFEC7949AC31857B6599@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
src/backend/commands/copyfrom.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/backend/commands/copyfrom.c b/src/backend/commands/copyfrom.c
index 0d6b34206aa..7b3f5a84b82 100644
--- a/src/backend/commands/copyfrom.c
+++ b/src/backend/commands/copyfrom.c
@@ -1340,10 +1340,6 @@ BeginCopyFrom(ParseState *pstate,
cstate->whereClause = whereClause;
- MemoryContextSwitchTo(oldcontext);
-
- oldcontext = MemoryContextSwitchTo(cstate->copycontext);
-
/* Initialize state variables */
cstate->eol_type = EOL_UNKNOWN;
cstate->cur_relname = RelationGetRelationName(cstate->rel);
[parent: c330b75d9cce]