timescaledb_experimental.policies

The policies view provides information on all policies set on continuous aggregates.

note

Only policies applying to continuous aggregates are shown in this view. Policies applying to regular hypertables or regular materialized views are not displayed.

warning

Experimental features could have bugs. They might not be backwards compatible, and could be removed in future releases. Use these features at your own risk, and do not use any experimental features in production.

Available columns

ColumnTypeDescription
relation_nameName of the continuous aggregate
relation_schemaSchema of the continuous aggregate
schedule_intervalHow often the policy job runs
proc_schemaSchema of the policy job
proc_nameName of the policy job
configConfiguration details for the policy job
hypertable_schemaSchema of the hypertable that contains the actual data for the continuous aggregate view
hypertable_nameName of the hypertable that contains the actual data for the continuous aggregate view

Sample usage

Select from the timescaledb_experimental.policies table to view it:

  1. SELECT * FROM timescaledb_experimental.policies;

Example of the returned output:

  1. -[ RECORD 1 ]--------------------------------------------------------------------
  2. relation_name | mat_m1
  3. relation_schema | public
  4. schedule_interval | @ 1 hour
  5. proc_schema | _timescaledb_internal
  6. proc_name | policy_refresh_continuous_aggregate
  7. config | {"end_offset": 1, "start_offset", 10, "mat_hypertable_id": 2}
  8. hypertable_schema | _timescaledb_internal
  9. hypertable_name | _materialized_hypertable_2
  10. -[ RECORD 2 ]--------------------------------------------------------------------
  11. relation_name | mat_m1
  12. relation_schema | public
  13. schedule_interval | @ 1 day
  14. proc_schema | _timescaledb_internal
  15. proc_name | policy_compression
  16. config | {"hypertable_id": 2, "compress_after", 11}
  17. hypertable_schema | _timescaledb_internal
  18. hypertable_name | _materialized_hypertable_2
  19. -[ RECORD 3 ]--------------------------------------------------------------------
  20. relation_name | mat_m1
  21. relation_schema | public
  22. schedule_interval | @ 1 day
  23. proc_schema | _timescaledb_internal
  24. proc_name | policy_retention
  25. config | {"drop_after": 20, "hypertable_id": 2}
  26. hypertable_schema | _timescaledb_internal
  27. hypertable_name | _materialized_hypertable_2