pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: David Gauthier <dfgpostgres@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: running \copy through perl dbi ?
Date: Fri, 8 Dec 2023 08:01:37 -0800
Message-ID: <fc49562b-59ce-4092-82b3-1d940d8754d9@aklaver.com> (raw)
In-Reply-To: <CAEs=6DmZLwYre2AF8Li0HgL8AKFG3NwAzGEonLO0TGPk2fsZdg@mail.gmail.com>
References: <CAEs=6DmZLwYre2AF8Li0HgL8AKFG3NwAzGEonLO0TGPk2fsZdg@mail.gmail.com>

On 12/8/23 07:45, David Gauthier wrote:
> Hi:
> 
> I'm trying to run a PG client side "\copy" command from a perl script.  
> I tried using $dbh->do("\\copy ...") but it barffed when it saw the '\'...
> ERROR:  syntax error at or near "\"
> 
> I can do this with a command line approach, attaching to the DB  then 
> run using...
> -c "\copy ...".  But I was wondering if there is a more elegant way to 
> do this, maybe some sort of legal SQL command that Perl/DBI would 
> swallow ???

Per David Johnston post:

https://metacpan.org/pod/DBD::Pg#COPY-support

> 
> Thanks in Advance !
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (10+ messages)  latest in thread

Message-ID: <fc49562b-59ce-4092-82b3-1d940d8754d9@aklaver.com>
Permalink:  ../fc49562b-59ce-4092-82b3-1d940d8754d9@aklaver.com/
Also on:    postgresql.org/message-id/fc49562b-59ce-4092-82b3-1d940d8754d9@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, dfgpostgres@gmail.com
  Subject: Re: running \copy through perl dbi ?
  In-Reply-To: <fc49562b-59ce-4092-82b3-1d940d8754d9@aklaver.com>
  References: <CAEs=6DmZLwYre2AF8Li0HgL8AKFG3NwAzGEonLO0TGPk2fsZdg@mail.gmail.com> <fc49562b-59ce-4092-82b3-1d940d8754d9@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox