datacube.drivers.common_psql.has_role#

datacube.drivers.common_psql.has_role(conn, role_name, with_create_role=False, superuser=False)[source]#

Check if a role exists.

Parameters:
  • conn (Connection) – A SQLAlchemy connection object

  • role_name (str) – The name of the role being checked

  • with_create_role (bool) – Only return true if the role has the createrole attribute

  • superuser (bool) – Only return true if the role is a PostgreSQL superuser

Return type:

bool

Returns:

True if the role exists (with the specified attributes)