Skip to main content
Early access Remove refresh, , and data retention policies from a . The removed and retention policies apply to the , not to the original .
timescaledb_experimental.remove_policies(
     relation REGCLASS,
     if_exists BOOL = false,
     VARIADIC policy_names TEXT[] = NULL
) RETURNS BOOL
To remove all policies on a , see remove_all_policies().

Samples

Given a 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 has a policy, leave it unchanged:
SELECT timescaledb_experimental.remove_policies(
    'example_continuous_aggregate',
    false,
    'policy_refresh_continuous_aggregate',
    'policy_retention'
);

Arguments

NameTypeDefaultRequiredDescription
relationREGCLASS-The to remove policies from
if_existsBOOLfalse-When true, prints a warning instead of erroring if the policy doesn’t exist.
policy_namesTEXT--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

Returns true if successful.