Remove redundant memory context switches in BeginCopyFrom().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 19 Jan 2022 17:31:15 +0000 (12:31 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 19 Jan 2022 17:31:15 +0000 (12:31 -0500)
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

index 0d6b34206aaf5ed951210d350685d9032b5e4f80..7b3f5a84b82d07adebea16668cc4d57c1155f7ea 100644 (file)
@@ -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);