Skip to content

remove_all_policies()

Remove all policies from a continuous aggregate

Early access 2.10.0

Remove all policies from a continuous aggregate. The removed columnstore and retention policies apply to the continuous aggregate, not to the original hypertable.

timescaledb_experimental.remove_all_policies(
relation REGCLASS,
if_exists BOOL = false
) RETURNS BOOL

Remove all policies from a continuous aggregate named example_continuous_aggregate. This includes refresh policies, columnstore policies, and data retention policies. It doesn’t include custom jobs:

SELECT timescaledb_experimental.remove_all_policies('example_continuous_aggregate');

The syntax is:

SELECT timescaledb_experimental.remove_all_policies(
relation = '<view_name>',
if_exists = true | false
);
NameTypeDefaultRequiredDescription
relationREGCLASS-The continuous aggregate to remove all policies from
if_existsBOOLfalse-When true, prints a warning instead of erroring if any policies are missing.

Returns true if successful.