def schema_remove(dbname, name, user=None, db_user=None, db_password=None, db_host=None, db_port=None):
 if (not schema_exists(dbname, name, db_user=db_user, db_password=db_password, db_host=db_host, db_port=db_port)):
  log.info("Schema '{0}' does not exist in '{1}'".format(name, dbname))
  return False
 sub_cmd = 'DROP SCHEMA "{0}"'.format(name)
 _psql_prepare_and_run(['-c', sub_cmd], runas=user, maintenance_db=dbname, host=db_host, user=db_user, port=db_port, password=db_password)
 if (not schema_exists(dbname, name, db_user=db_user, db_password=db_password, db_host=db_host, db_port=db_port)):
  return True
 else:
  log.info("Failed to delete schema '{0}'.".format(name))
  return False

def schema_remove ( dbname , name , user = None , db_user = None , db_password = None , db_host = None , db_port = None ) : if ( not schema_exists ( dbname , name , db_user = db_user , db_password = db_password , db_host = db_host , db_port = db_port ) ) : log . info ( "Schema '{0}' does not exist in '{1}'" . format ( name , dbname ) ) return False sub_cmd = 'DROP SCHEMA "{0}"' . format ( name ) _psql_prepare_and_run ( [ '-c' , sub_cmd ] , runas = user , maintenance_db = dbname , host = db_host , user = db_user , port = db_port , password = db_password ) if ( not schema_exists ( dbname , name , db_user = db_user , db_password = db_password , db_host = db_host , db_port = db_port ) ) : return True else : log . info ( "Failed to delete schema '{0}'." . format ( name ) ) return False
removes a schema from the postgres server .