def METHOD_NAME(config, dump_name):
    if not config.allow_destroy_db():
        logger.error(
            "Refusing to do a destructive database operation "
            "because the allow_destroy_db configuration option "
            "is set to false."
        )
        return False
    env = os.environ.copy()
    env.update(config.get_pg_environment())
    db_dump_file_name = os.path.join(config.get_database_dump_path(), dump_name)
    if not os.path.isfile(db_dump_file_name):
        logger.error("file %s does not exist: " % db_dump_file_name)
        return False
    logger.debug("Restoring %s" % db_dump_file_name)
    cmd = (
        config.get_pg_restore_binary(),
        "-d",
        env["PGDATABASE"],
        "-O",
        "-n",
        "public",
        "-x",
        db_dump_file_name,
    )
    logger.trace("Executing %s" % str(cmd))
    proc = subprocess.Popen(
        cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE
    )
    (stdout, stderr) = proc.communicate()
    if stderr != "":
        logger.error("An error occured while calling pg_restore: %s " % stderr)
        return False
    return True