Re: help on automatically running sql files - Mailing list pgsql-admin

From Pradeepkumar, Pyatalo (IE10)
Subject Re: help on automatically running sql files
Date
Msg-id 77ED2BF75D59D1439F90412CC5B1097410F3C901@ie10-sahara.hiso.honeywell.com
Whole thread Raw
In response to help on automatically running sql files  ("Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo@honeywell.com>)
Responses Re: help on automatically running sql files  ("Scott Marlowe" <smarlowe@qwest.net>)
Re: help on automatically running sql files  (Gémes Géza <geza@kzsdabas.sulinet.hu>)
List pgsql-admin

On Tue, 2004-08-31 at 01:33, Pradeepkumar, Pyatalo (IE10) wrote:
> Hi all,
> For the project that I am working on , we are using Postgresql 7.4.3 on
> Linux 7.2. We have all the database tables,triggers and stored procedures
as
> seperate .sql files which we want to ship as part of our software. Now
when
> the user installs our software, we need to check if postmaster service is
> running or not and if it is running, then we have to run the sql files
> automatically. Can anyone help me out on how to run the .sql files
> automatically.

Something like psql dbname <sqlfile.sql will do.  If psql isn't in the
path, then /path/to/psql dbname <sqlfile.sql


Hi Scott,
What we really require is, if we ship the .sql files as part of our software
package, the user should not do anything. The software when it installs
should automatically run the .sql files without the user intervention. We
dont want the user to check for the .sql files and run the above command
himself. We want to automate that in our software. Is that possible in
postgresql. If yes, how to do it. If no, is there any alternative solution.
I can think of one alternative that is to write a shell script.

pgsql-admin by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: help on automatically running sql files
Next
From: "Scott Marlowe"
Date:
Subject: Re: help on automatically running sql files