pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedhelp on automatically running sql files
5+ messages / 3 participants
[nested] [flat]
* help on automatically running sql files
@ 2004-08-31 07:33 Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
0 siblings, 1 reply; 5+ messages in thread
From: Pradeepkumar, Pyatalo (IE10) @ 2004-08-31 07:33 UTC (permalink / raw)
To: pgsql-admin
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.
> With Best Regards
> Pradeep Kumar P J
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: help on automatically running sql files
@ 2004-08-31 07:57 Scott Marlowe <smarlowe@qwest.net>
parent: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
0 siblings, 0 replies; 5+ messages in thread
From: Scott Marlowe @ 2004-08-31 07:57 UTC (permalink / raw)
To: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>; +Cc: 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: help on automatically running sql files
@ 2004-08-31 08:40 Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
0 siblings, 2 replies; 5+ messages in thread
From: Pradeepkumar, Pyatalo (IE10) @ 2004-08-31 08:40 UTC (permalink / raw)
To: Scott Marlowe <smarlowe@qwest.net>; Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>; +Cc: 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.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: help on automatically running sql files
@ 2004-08-31 09:14 Scott Marlowe <smarlowe@qwest.net>
parent: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
1 sibling, 0 replies; 5+ messages in thread
From: Scott Marlowe @ 2004-08-31 09:14 UTC (permalink / raw)
To: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>; +Cc: pgsql-admin
On Tue, 2004-08-31 at 02:40, Pradeepkumar, Pyatalo (IE10) wrote:
> 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.
That's pretty much what I was thinking when I made my suggestion.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: help on automatically running sql files
@ 2004-08-31 10:09 Gémes Géza <geza@kzsdabas.sulinet.hu>
parent: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
1 sibling, 0 replies; 5+ messages in thread
From: Gémes Géza @ 2004-08-31 10:09 UTC (permalink / raw)
To: Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>; +Cc: Scott Marlowe <smarlowe@qwest.net>; pgsql-admin
Pradeepkumar, Pyatalo (IE10) írta:
>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.
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>
Your software installs somehow. Posibilities:
-Via a shell/perl install script: append at the end of the script
- Via a graphical install programm: append at the end of the programs
main part as the last thing to do (easiest way (but less performant):
via an exec statement)
- Via rpm/deb/whatever else: In this case the packager usualy have a
postinstall part, where you can put this script, which checks for the
runing postgresql instance, and then run the required .sql files
Regards,
Geza Gemes
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2004-08-31 10:09 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-08-31 07:33 help on automatically running sql files Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
2004-08-31 07:57 ` Scott Marlowe <smarlowe@qwest.net>
2004-08-31 08:40 Re: help on automatically running sql files Pradeepkumar, Pyatalo (IE10) <Pradeepkumar.Pyatalo@honeywell.com>
2004-08-31 09:14 ` Scott Marlowe <smarlowe@qwest.net>
2004-08-31 10:09 ` Gémes Géza <geza@kzsdabas.sulinet.hu>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox