alter_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.
Alter refresh, compression, or data retention policies on a continuous aggregate. The altered compression and retention policies apply to the continuous aggregate, not to the original hypertable.
timescaledb_experimental.alter_policies(relation REGCLASS,if_exists BOOL = false,refresh_start_offset "any" = NULL,refresh_end_offset "any" = NULL,compress_after "any" = NULL,drop_after "any" = NULL) RETURNS BOOL
Experimental features could have bugs. They might not be backwards compatible, and could be removed in future releases. Use these features at your own risk, and do not use any experimental features in production.
|The continuous aggregate that you want to alter policies for|
|When true, prints a warning instead of erroring if the policy doesn't exist. Defaults to false.|
|The start of the continuous aggregate refresh window, expressed as an offset from the policy run time.|
|The end of the continuous aggregate refresh window, expressed as an offset from the policy run time. Must be greater than |
|Continuous aggregate chunks are compressed if they exclusively contain data older than this interval.|
|Continuous aggregate chunks are dropped if they exclusively contain data older than this interval.|
For arguments that could be either an
INTERVAL or an
INTEGER, use an
INTERVAL if your time bucket is based on timestamps. Use an
INTEGER if your
time bucket is based on integers.
Returns true if successful.
Given a continuous aggregate named
example_continuous_aggregate with an
existing compression policy, alter the compression policy to compress data older
than 16 days:
SELECT timescaledb_experimental.alter_policies('continuous_agg_max_mat_date',compress_after => '16 days'::interval);
Found an issue on this page?Report an issue!