postgres scripting

Hi all,

I have to reindex 2 indexes in pg_catalog using postgres --single.
There are 16 seperate databases on each of 4 servers that I have to do
this on, so obviously it would be much better to script the changes. I
can handle identifying the dbs and starting postgres no problem, but I
can't seem to find a way to pass a CTRL-D character from within a bash
script to the postgres executable.

Has anyone done anything like this? Any suggestions? I am running
postgres 3.1.1.8 on Solaris 5.10.

Thanks!

John


John P Weatherman
Sr DBA
Asurion, Inc.


--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
John P Weatherman [ Mi, 16 September 2009 23:26 ] [ ID #2015993 ]

Re: postgres scripting

John P Weatherman <jweatherman91 [at] alumni.wfu.edu> wrote:

> can handle identifying the dbs and starting postgres no problem, but
I
> can't seem to find a way to pass a CTRL-D character from within a
bash
> script to the postgres executable.

Why not put the SQL in a separate file and pipe it in?
(I haven't tested that, but it seems likely to work....)

-Kevin

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Kevin Grittner [ Do, 17 September 2009 01:35 ] [ ID #2016142 ]

Re: postgres scripting

John P Weatherman <jweatherman91 [at] alumni.wfu.edu> writes:
> I can't seem to find a way to pass a CTRL-D character from within a bash
> script to the postgres executable.

Control-D is just a way to signal EOF from the keyboard. If you're
scripting, reaching the end of the script input does the same thing.

regards, tom lane

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Tom Lane [ Do, 17 September 2009 04:38 ] [ ID #2016143 ]
Datenbanken » gmane.comp.db.postgresql.admin » postgres scripting

Vorheriges Thema: pgAgent Windows service startup time
Nächstes Thema: locking issues with pg_dump and vacuum (win server 2003)