- print "STATUS: archiving old database"
- archive_db = "psql template1 postgres -qc " \
- " 'ALTER DATABASE %s RENAME TO %s;';" \
- " createdb -U postgres %s > /dev/null; " % \
- (database, archived_database, database)
+ print "Status: archiving old database"
+ archive_db = " dropdb -U postgres %s; > /dev/null 2>&1" \
+ " psql template1 postgres -qc " \
+ " 'ALTER DATABASE %s RENAME TO %s;';" \
+ " createdb -U postgres %s > /dev/null; " % \
+ (archived_database, database, archived_database, database)