示例#1
0
def pg_reset_database(backup_name, db_name, owner):
    '''
    Drop database, create database and restore from backup.
    '''

    tasks.pg_drop_db(db_name, False)
    tasks.pg_create_db(db_name, owner)
    tasks.pg_restore(backup_name, db_name, owner)
    print "*** Resetted database %s with backup %s" % (db_name, backup_name)
示例#2
0
def pg_reset_database(backup_name, db_name, owner):
    """
    Drop database, create database and restore from backup.
    """

    tasks.pg_drop_db(db_name, False)
    tasks.pg_create_db(db_name, owner)
    tasks.pg_restore(backup_name, db_name, owner)
    print("*** Resetted database {db_name} with backup {backup_name}".format(
        db_name=db_name, backup_name=backup_name))