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

# remove_all_policies()

> Remove all policies from a continuous aggregate

export const COLUMNSTORE = 'columnstore';

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]

Remove all policies from a {CAGG}. The removed {COLUMNSTORE} and
retention policies apply to the {CAGG}, *not* to the original
{HYPERTABLE}.

```sql theme={"dark"}
timescaledb_experimental.remove_all_policies(
     relation REGCLASS,
     if_exists BOOL = false
) RETURNS BOOL
```

## Samples

Remove all policies from a {CAGG} named
`example_continuous_aggregate`. This includes refresh policies, {COLUMNSTORE}
policies, and data retention policies. It doesn't include custom jobs:

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

## Arguments

The syntax is:

```sql theme={"dark"}
SELECT timescaledb_experimental.remove_all_policies(
    relation = '<view_name>',
    if_exists = true | false
);
```

| Name        | Type       | Default | Required | Description                                                                  |
| ----------- | ---------- | ------- | -------- | ---------------------------------------------------------------------------- |
| `relation`  | `REGCLASS` | -       | ✔        | The {CAGG} to remove all policies from                                       |
| `if_exists` | `BOOL`     | false   | -        | When true, prints a warning instead of erroring if any policies are missing. |

## Returns

Returns `true` if successful.

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