Re: running \copy through perl dbi ? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: running \copy through perl dbi ?
Date
Msg-id fc49562b-59ce-4092-82b3-1d940d8754d9@aklaver.com
Whole thread Raw
In response to running \copy through perl dbi ?  (David Gauthier <dfgpostgres@gmail.com>)
Responses Re: running \copy through perl dbi ?
List pgsql-general
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




pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: running \copy through perl dbi ?
Next
From: "David G. Johnston"
Date:
Subject: Re: running \copy through perl dbi ?