datacube.drivers.common_psql.transfer_ownership#

datacube.drivers.common_psql.transfer_ownership(conn, schema, obj_name, current_owner, new_owner, object_type)[source]#

Transfer ownership of a database object to a new owner.

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

  • schema (str) – The schema containing the object.

  • obj_name (str) – The name of the object.

  • current_owner (str) – The current owner of the object.

  • new_owner (str) – The desired new owner of the object.

  • object_type (Literal['tables', 'matviews', 'views']) – The type of object, one of “tables”, “matviews”, “views”.

Return type:

bool

Returns:

True if the transfer succeeded, False otherwise.