remove_policies()
CommunityCommunity functions are available under Timescale Community Edition. Click to learn more.ExperimentalExperimental features are not suitable for production environments. They are included under the TimescaleDB experimental schema. Click to learn more.Tiger Cloud: Performance, Scale, Enterprise, Free
Self-hosted products
MST
Remove refresh, columnstore, and data retention policies from a continuous aggregate. The removed columnstore and retention policies apply to the continuous aggregate, not to the original hypertable.
Warning
This experimental function will be removed in future releases. Please use the delete_job() function to delete policies.
timescaledb_experimental.remove_policies(relation REGCLASS,if_exists BOOL = false,VARIADIC policy_names TEXT[] = NULL) RETURNS BOOL
To remove all policies on a continuous aggregate, see
remove_all_policies().
Given a continuous aggregate named example_continuous_aggregate with a refresh
policy and a data retention policy, remove both policies.
Throw an error if either policy doesn't exist. If the continuous aggregate has a columnstore policy, leave it unchanged:
SELECT timescaledb_experimental.remove_policies('example_continuous_aggregate',false,'policy_refresh_continuous_aggregate','policy_retention');
| Name | Type | Description |
|---|---|---|
relation | REGCLASS | The continuous aggregate to remove policies from |
| Name | Type | Description |
|---|---|---|
if_exists | BOOL | When true, prints a warning instead of erroring if the policy doesn't exist. Defaults to false. |
policy_names | TEXT | The policies to remove. You can list multiple policies, separated by a comma. Allowed policy names are policy_refresh_continuous_aggregate, policy_compression, and policy_retention. |
Returns true if successful.
Keywords
Found an issue on this page?Report an issue or Edit this page
in GitHub.