Database.create_database

Database.create_database(db_name: str, owner: str = 'postgres')[source]

Creates a database named db_name. If timescaledb_extension is set (default is ‘True’), the TimescaleDB extension is installed in the database to allow TimescaleDB hypertables.

Parameters
  • db_name (str) – The name of the database to be created

  • owner (str, optional) – Database owner, default is ‘postgres’.

Raises

psycopg2.Error – Base exception for all kind of database errors