postgresql/src/backend/commands
Michael Paquier dc084d7c73 Fix incorrect memory context switch in COPY TO execution
c532d15 has split the logic of COPY commands into multiple files, one
change being to move the internals of BeginCopy() to BeginCopyTo().
Originally the code was written so as we'd switch back-and-forth between
the current execution memory context and the dedicated memory context
for the COPY command, and this refactoring has introduced an extra
switch to the current memory context from the COPY context once
BeginCopyTo() is done with the past logic coming from BeginCopy().

The code was correctly doing the analyze, rewrite and planning phases in
the COPY context, but it was not assigning "copy_file" (FILE* used when
copying to a source file) and "filename" in the COPY context, making the
COPY status data inconsistent.

Author: Bharath Rupireddy
Reviewed-by: Japin Li
Discussion: https://postgr.es/m/CALj2ACWvVa69foi9jhHFY=2BuHxAoYboyE+vXQTARwxZcJnVrQ@mail.gmail.com
Backpatch-through: 14
2022-01-29 10:22:42 +09:00
..
Makefile Move parallel vacuum code to vacuumparallel.c. 2021-12-23 11:42:52 +05:30
aggregatecmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
alter.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
amcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
analyze.c Add stxdinherit flag to pg_statistic_ext_data 2022-01-16 13:38:01 +01:00
async.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
cluster.c Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
collationcmds.c Change collate and ctype fields to type text 2022-01-27 08:54:25 +01:00
comment.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
constraint.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
conversioncmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
copy.c Add HEADER support to COPY text format 2022-01-28 09:44:47 +01:00
copyfrom.c Remove redundant memory context switches in BeginCopyFrom(). 2022-01-19 12:31:15 -05:00
copyfromparse.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
copyto.c Fix incorrect memory context switch in COPY TO execution 2022-01-29 10:22:42 +09:00
createas.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dbcommands.c Change collate and ctype fields to type text 2022-01-27 08:54:25 +01:00
define.c Add Boolean node 2022-01-17 10:38:23 +01:00
discard.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dropcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
event_trigger.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
explain.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
extension.c Improve error message for missing extension. 2022-01-11 14:22:00 -05:00
foreigncmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
functioncmds.c Add Boolean node 2022-01-17 10:38:23 +01:00
indexcmds.c Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
lockcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
matview.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
opclasscmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
operatorcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
policy.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
portalcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
prepare.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
proclang.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
publicationcmds.c Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
schemacmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
seclabel.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
sequence.c Add Boolean node 2022-01-17 10:38:23 +01:00
statscmds.c Check syscache result in AlterStatistics 2022-01-23 03:16:31 +01:00
subscriptioncmds.c Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
tablecmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
tablespace.c pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
trigger.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
tsearchcmds.c Add Boolean node 2022-01-17 10:38:23 +01:00
typecmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
user.c Add Boolean node 2022-01-17 10:38:23 +01:00
vacuum.c Remove useless inline marker. 2022-01-22 17:11:33 -05:00
vacuumparallel.c Unify VACUUM VERBOSE and autovacuum logging. 2022-01-14 16:50:34 -08:00
variable.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
view.c Update copyright for 2022 2022-01-07 19:04:57 -05:00