createdb process hangs when batched

From: Scott Bradley <SBradley(at)accelrys(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: createdb process hangs when batched
Date: 2010-08-27 13:50:04
Message-ID: 5ACBA19439E77B43A06F4CAB897EC977024820CDC2@EXCH1-COLO.accelrys.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello -

I'm relatively new to the postgresql world - primarily using it to load up a backup of our hosted Jive community databases (which use postgresql).

To that end, we've created and scheduled a batch file (yes, we're using a windows server...) to download the backups (*.dmp files) from the hosted service and reload our local databases each night.

The process appears to work fine (i.e., the databases are loaded as expected), but every day there is another lingering instance of "createdb.exe" in the task manager. This does not appear to happen when I run the batch file manually from the command line - only when it runs as a scheduled task.

Here's a trimmed down version of the batch file - it's relatively simplistic at this point. Has anyone run into this issue, or have any suggestions for where to start...?

rem Remove previously downloaded backup files
del *.dmp

rem Use wget to download 2 backup files
"C:\Program Files\WinWget\wget\wget.exe" --http-user=%USER% --http-passwd=%PASS% "%ANALYTICS_DATABASE%.dmp"
"C:\Program Files\WinWget\wget\wget.exe" --http-user=%USER% --http-passwd=%PASS% "%FULL_BACKUP%.dmp"

rem Restart the windows service to ensure no connected users - otherwise dropdb will fail
net stop postgresql-8.4
net start postgresql-8.4

rem Drop existing databases
"c:\Program Files\PostgreSQL\8.4\bin\dropdb.exe" -U postgres -w jive_analytics
"c:\Program Files\PostgreSQL\8.4\bin\dropdb.exe" -U postgres -w jive_full

rem Recreate Analytics database
"c:\Program Files\PostgreSQL\8.4\bin\createdb" -U postgres jive_analytics
"c:\Program Files\PostgreSQL\8.4\bin\pg_restore" -U postgres -O -d jive_analytics "%ANALYTICS_DATABASE_FILE%.dmp"

rem Recreate Analytics database
"c:\Program Files\PostgreSQL\8.4\bin\createdb" -U postgres jive_full
"c:\Program Files\PostgreSQL\8.4\bin\pg_restore" -U postgres -O -d jive_full "%FULL_BACKUP_FILE%.dmp"

rem Grant access to all tables to jive_local user for both databases
"c:\Program Files\PostgreSQL\8.4\bin\psql.exe" -U postgres -d jive_full -qAt -c "select 'grant select on ' || tablename || ' to jive_local;' from pg_tables where schemaname = 'public'" | "c:\Program Files\PostgreSQL\8.4\bin\psql.exe" -U postgres -d jive_full

"c:\Program Files\PostgreSQL\8.4\bin\psql.exe" -U postgres -d jive_analytics -qAt -c "select 'grant select on ' || tablename || ' to jive_local;' from pg_tables where schemaname = 'public'" | "c:\Program Files\PostgreSQL\8.4\bin\psql.exe" -U postgres -d jive_analytics

Browse pgsql-general by date

  From Date Subject
Next Message Callum Scott 2010-08-27 15:08:11 Index File locations
Previous Message Vyacheslav Kalinin 2010-08-27 13:41:20 Scalar subquery