Skip to content

hdx.database.postgresql

module hdx.database.postgresql

PostgreSQL specific utilities

Classes

Functions

class PostgresError()

Bases : Exception

wait_for_postgresql(db_uri: str)None

Waits for PostgreSQL database to be up

Parameters

  • db_uri : str Connection URI

Returns

  • None None

restore_from_pgfile(db_uri: str, pg_restore_file: Path | str)str

Restore database from a pg_restore file created by pg_backup using the pg_restore command.

Parameters

  • db_uri : str Connection URI

  • pg_restore_file : Path | str Path to the pg_restore database file

Returns

  • str Output from the pg_restore command

Raises