On Fri, 30 Aug 2019, Tom Lane wrote:
FWIW, if you're running a current release then there's a reasonable alternative for writing multi-line COPY-from-query commands; see commit log below.
Thanks, Tom. I'm running 11.1 and plan to upgrade to 11.5 this weekend. Regards, Rich