From: Tom Lane Date: Wed, 19 Jan 2022 17:31:15 +0000 (-0500) Subject: Remove redundant memory context switches in BeginCopyFrom(). X-Git-Tag: REL_15_BETA1~872 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89f059bdf52cc9a86b890d42ceed92237123479e;p=thirdparty%2Fpostgresql.git 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 --- 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);