> ## 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.

# show_policies()

> Show all policies that are currently set on a continuous aggregate

export const CAGG = 'continuous aggregate';

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

Show all policies that are currently set on a {CAGG}.

```sql theme={"dark"}
timescaledb_experimental.show_policies(
     relation REGCLASS
) RETURNS SETOF JSONB
```

## Samples

Given a {CAGG} named `example_continuous_aggregate`, show all the
policies set on it:

```sql theme={"dark"}
SELECT timescaledb_experimental.show_policies('example_continuous_aggregate');
```

Example of returned data:

```bash theme={"dark"}
show_policies
--------------------------------------------------------------------------------
{"policy_name": "policy_compression", "compress_after": 11, "compress_interval": "@ 1 day"}
{"policy_name": "policy_refresh_continuous_aggregate", "refresh_interval": "@ 1 hour", "refresh_end_offset": 1, "refresh_start_offset": 10}
{"drop_after": 20, "policy_name": "policy_retention", "retention_interval": "@ 1 day"}
```

## Arguments

The syntax is:

```sql theme={"dark"}
SELECT * FROM show_policies(
    relation = '<view_name>'
);
```

| Name       | Type       | Default | Required | Description                        |
| ---------- | ---------- | ------- | -------- | ---------------------------------- |
| `relation` | `REGCLASS` | -       | ✔        | The {CAGG} to display policies for |

## Returns

| Column          | Type    | Description                               |
| --------------- | ------- | ----------------------------------------- |
| `show_policies` | `JSONB` | Details for each policy set on the {CAGG} |

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