On Wed, 10 Oct 2018 at 16:22, Ravi Krishna <srkrish...@aol.com> wrote: > You obviously are referring to multiple connections running COPY on different > tables, right? Like what pg_restore does with -j option. > Doesn't copy take an exclusive lock on the table which makes it incompatible > with parallelization.
No, why would that seem to be the case? If it did so, then you could not run pg_dump to dump data while regular activity was going on. That's decidedly not the case. The challenge in parallelizing a dump via COPY TO is in ensuring that the multiple requests are attached to the same serializable transaction. There's a function now that allows multiple connections to attach to the same transaction context, I believe... Also, there's the challenge in actually splitting the data, so that both requests are dumping different data; that might be fairly expensive whether with or without indices. -- When confronted by a difficult problem, solve it by reducing it to the question, "How would the Lone Ranger handle this?"