Skip to content
TimescaleDB - Timeseries database for PostgreSQL Docs
  • Timescale.com
  • Try for free
Get started
Create your first Timescale service
Try the key Timescale features
Start coding with Timescale
About Timescale products
Timescale architecture for real-time analytics
Pricing plans and account management
Changelog
Use Timescale
Hypertables
Hypercore
Continuous aggregates
Tutorials
Integrations
API Reference
Hypertables & chunks
Hypercore
Continuous aggregates
Data retention
add_retention_policy
remove_retention_policy
Jobs and automation
Hyperfunctions
Informational views
Configuration
Administration Functions
API Reference Tag Overview
Compression (Old API, replaced by Hypercore)
Distributed hypertables (Sunsetted v2.14.x)
Migrate and sync data to Timescale Cloud
AI and Vector: pgai on Timescale
Other deployment options
Find a docs page
TimescaleDB API referenceData retention

remove_retention_policy()

CommunityCommunity functions are available under Timescale Community Edition. Click to learn more.

Remove a policy to drop chunks of a particular hypertable.

Required arguments

NameTypeDescription
relationREGCLASSName of the hypertable or continuous aggregate from which to remove the policy

Optional arguments

NameTypeDescription
if_existsBOOLEANSet to true to avoid throwing an error if the policy does not exist. Defaults to false.

Sample usage

SELECT remove_retention_policy('conditions');

Removes the existing data retention policy for the conditions table.

Keywords

data retentionpoliciesremove

Found an issue on this page?Report an issue or Edit this page in GitHub.

Previousadd_retention_policyNextJobs and automation

Related Content

remove_reorder_policy()
Remove a reorder policy from a hypertable
add_retention_policy()
Add a policy to drop older chunks
remove_compression_policy()
Remove a compression policy from a hypertable
remove_continuous_aggregate_policy()
Remove a refresh policy from a continuous aggregate
Data retention
Timescale Cloud API reference for data retention. Includes SQL functions for adding and removing data retention policies that run on a schedule that you define
drop_chunks()
Delete chunks by time range