Re: running \copy through perl dbi ?

2023-12-11 Thread Chris Travers
\copy in psql just wraps PostgreSQL's COPY FROM STDIN. if you are trying to do it from your own client program it is trivial to change to that call instead. On Mon, Dec 11, 2023 at 4:09 PM Vincent Veyron wrote: > On Fri, 8 Dec 2023 10:45:28 -0500 > David Gauthier wrote: > > > > I'm trying to

Re: running \copy through perl dbi ?

2023-12-11 Thread Vincent Veyron
On Fri, 8 Dec 2023 10:45:28 -0500 David Gauthier wrote: > > 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,

Re: [EXT]Re: running \copy through perl dbi ?

2023-12-10 Thread Adrian Klaver
On 12/10/23 10:34, Johnson, Bruce E - (bjohnson) wrote: On Dec 10, 2023, at 10:41 AM, Vincent Veyron > wrote: External Email On Fri, 8 Dec 2023 10:45:28 -0500 Duh! I just realized that what I proposed with system() is a command line approach. As David

Re: [EXT]Re: running \copy through perl dbi ?

2023-12-10 Thread Johnson, Bruce E - (bjohnson)
On Dec 10, 2023, at 10:41 AM, Vincent Veyron mailto:vv.li...@wanadoo.fr>> wrote: External Email On Fri, 8 Dec 2023 10:45:28 -0500 David Gauthier mailto:dfgpostg...@gmail.com>> wrote: I'm trying to run a PG client side "\copy" command from a perl script. I tried using $dbh->do("\\copy ...")

Re: running \copy through perl dbi ?

2023-12-10 Thread Vincent Veyron
On Fri, 8 Dec 2023 10:45:28 -0500 David Gauthier wrote: > > 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,

Re: running \copy through perl dbi ?

2023-12-08 Thread Vincent Veyron
On Fri, 8 Dec 2023 10:45:28 -0500 David Gauthier wrote: > > 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 "\" Hi David, This works for me : #create file

Re: running \copy through perl dbi ?

2023-12-08 Thread David G. Johnston
On Fri, Dec 8, 2023 at 9:01 AM Adrian Klaver wrote: > 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

Re: running \copy through perl dbi ?

2023-12-08 Thread Adrian Klaver
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 

Re: running \copy through perl dbi ?

2023-12-08 Thread David G. Johnston
On Fri, Dec 8, 2023 at 8:45 AM David Gauthier wrote: > > 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 "\" > More accurately it is the psql application's

running \copy through perl dbi ?

2023-12-08 Thread David Gauthier
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