Database.create_aggregate_view

Database.create_aggregate_view(table_name: str, index_name: str = 'time', recreate: bool = True)[source]

Creates a set of aggregate views in a given table.

Parameters

table_name (str) – Name of the table where the column has to be created.

index_namestr, optional

Column to be used as index for the aggregate view, default is ‘time’.

recreatebool, optional

Recreate the aggregate view if it exists, default is ‘True’.

Raises

psycopg2.Error – Base exception for all kind of database errors. In particular, it is raised if the table does not exist or the aggregate view could not be created.