Run external SQL file via Perl dbh

From: David Williams <mobiusinversion(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Run external SQL file via Perl dbh
Date: 2012-06-09 22:29:50
Message-ID: 8418C16F-C477-496A-A296-1543D9C09DD4@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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 database handle?

Best regards
David

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Evan Rempel 2012-06-09 22:41:34 is there a select for update insert if not exist type command?
Previous Message Tom Lane 2012-06-09 15:18:00 Re: Extending SQL C-language multidimension arrays