> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-poc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# timescaledb_experimental.policies

> Get information about all policies set on continuous aggregates

export const HYPERTABLE = 'hypertable';

export const CAGG = 'continuous aggregate';

<Icon icon="flask" /> Early access <Icon icon="tag" iconType="duotone" /> Since [2.10.0][tsdb-2.10.0]

The `policies` view provides information on all policies set on {CAGG}s.

<Info>
  Only policies applying to {CAGG}s are shown in this view. Policies
  applying to regular {HYPERTABLE}s or regular materialized views are not displayed.
</Info>

## Samples

Select from the `timescaledb_experimental.policies` table to view it:

```sql theme={"dark"}
SELECT * FROM timescaledb_experimental.policies;
```

Example of the returned output:

```sql theme={"dark"}
-[ RECORD 1 ]--------------------------------------------------------------------
relation_name     | mat_m1
relation_schema   | public
schedule_interval | @ 1 hour
proc_schema       | _timescaledb_internal
proc_name         | policy_refresh_continuous_aggregate
config            | {"end_offset": 1, "start_offset", 10, "mat_hypertable_id": 2}
hypertable_schema | _timescaledb_internal
hypertable_name   | _materialized_hypertable_2
-[ RECORD 2 ]--------------------------------------------------------------------
relation_name     | mat_m1
relation_schema   | public
schedule_interval | @ 1 day
proc_schema       | _timescaledb_internal
proc_name         | policy_compression
config            | {"hypertable_id": 2, "compress_after", 11}
hypertable_schema | _timescaledb_internal
hypertable_name   | _materialized_hypertable_2
-[ RECORD 3 ]--------------------------------------------------------------------
relation_name     | mat_m1
relation_schema   | public
schedule_interval | @ 1 day
proc_schema       | _timescaledb_internal
proc_name         | policy_retention
config            | {"drop_after": 20, "hypertable_id": 2}
hypertable_schema | _timescaledb_internal
hypertable_name   | _materialized_hypertable_2
```

## Returns

| Column              | Type     | Description                                                                  |
| ------------------- | -------- | ---------------------------------------------------------------------------- |
| `relation_name`     | TEXT     | Name of the {CAGG}                                                           |
| `relation_schema`   | TEXT     | Schema of the {CAGG}                                                         |
| `schedule_interval` | INTERVAL | How often the policy job runs                                                |
| `proc_schema`       | TEXT     | Schema of the policy job                                                     |
| `proc_name`         | TEXT     | Name of the policy job                                                       |
| `config`            | JSONB    | Configuration details for the policy job                                     |
| `hypertable_schema` | TEXT     | Schema of the {HYPERTABLE} that contains the actual data for the {CAGG} view |
| `hypertable_name`   | TEXT     | Name of the {HYPERTABLE} that contains the actual data for the {CAGG} view   |

[tsdb-2.10.0]: https://github.com/timescale/timescaledb/releases/tag/2.10.0
