Re: [GENERAL] Run external SQL file via Perl dbh

2012-06-11 Thread Chris Travers
On Mon, Jun 11, 2012 at 7:37 PM, Greg Williamson wrote: > Toby -- > > A small point: > > <...> > As a brief note, the semicolon splitting issue was why we went with invoking psql via system(). We found that was vastly simpler than trying to handle all corner cases ourselves. Best Wishes, Chris T

Re: [GENERAL] Run external SQL file via Perl dbh

2012-06-11 Thread Greg Williamson
Toby -- A small point: <...> >How about something like > >use File::Slurp; >use Try::Tiny; > >try { >  $dbh->being_work; $dbh-begin_work; <...> Clarification for any who might be unfamiliar with the perl tools. Greg Williamson -- Sent via pgsql-general mailing list (pgsql-general@postgre

Re: [GENERAL] Run external SQL file via Perl dbh

2012-06-11 Thread Toby Corkindale
On 10/06/12 08:29, David Williams wrote: Hi There, I'd like to be able to run the contents of an external SQL file from Perl. Something akin to: $dbh->do( '\i /home/david/run_me.sql' ); However this fails, and I assume that is because the \i is a client command. Is there a way to run

Re: [GENERAL] Run external SQL file via Perl dbh

2012-06-10 Thread Chris Travers
On Sat, Jun 9, 2012 at 3:29 PM, David Williams wrote: > > Hi There, > > I'd like to be able to run the contents of an external SQL file from Perl.   > Something akin to: > >    $dbh->do( '\i /home/david/run_me.sql' ); > > However this fails, and I assume that is because the \i is a client command.

[GENERAL] Run external SQL file via Perl dbh

2012-06-10 Thread David Williams
Hi There, I'd like to be able to run the contents of an external SQL file from Perl. Something akin to: $dbh->do( '\i /home/david/run_me.sql' ); However this fails, and I assume that is because the \i is a client command. Is there a way to run the contents of an external SQL from a Per d