title: How can I use DBI to execute a "\copy from remote table" command in Postgres?
body: <p>I need to copy from a remote PostgreSQL server to a local one. I cannot use any ETL tools, it must be done using Perl with DBI. This data will be large, so I don't want to use &quot;select from source&quot; and &quot;insert into local&quot;. I was looking to use COPY to create a file, but this file will be created on the remote server. I can't do that either. I want to use \COPY instead.</p>
  <p>How can I use DBI to execute a &quot;\copy from remote table&quot; command and create a local file using DBI in Perl?</p>