Skip site navigation (1) Skip section navigation (2)

dbi:pg and meta commands

From: A Gilmore <agilmore(at)shaw(dot)ca>
To: pgsqlnovice <pgsql-novice(at)postgresql(dot)org>
Subject: dbi:pg and meta commands
Date: 2005-09-13 01:04:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

Im attempting to write a script that runs .sql files.  I have several 
databases, Id like the script to log into each database, do some queries 
to check the data, and based on those queries decided to run a given 
.sql file or not.

Ive been using perl and dbi, however Ive always run SQL statements from 
a file using the meta-command \i.  However DBI seems to choke on this. 
Running the files from the shell doesn't work due to the script tripping 
on the password prompt (which I cannot get around on this setup).

Does anyone have any suggestions on how I can either run meta commands 
via DBI or dodge the password prompt without changing the security 
setup?  Or maybe a different approach entirely.

Thank you for any suggestions,
-A Gilmore

pgsql-novice by date

Next:From: John DeSoiDate: 2005-09-13 01:35:49
Subject: Re: psql, pg_dumpall, remote server questions...
Previous:From: operationsengineer1Date: 2005-09-12 23:46:18
Subject: psql, pg_dumpall, remote server questions...

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group