Skip to main content
Community Since 1.2.0 Create a policy to drop s older than a given interval of a particular or on a schedule in the background. For more information, see drop_chunks. This implements a data retention policy and removes data on a schedule. Only one retention policy may exist per . When you create a retention policy on a with an integer based time column, you must set the integer_now_func to match your data. If you are seeing invalid value issues when you call add_retention_policy, set VERBOSITY verbose to see the full context.

Samples

  • Create a data retention policy to discard chunks greater than 6 months old:
    When you call drop_after, the time data range present in the partitioning time column is used to select the target s.
  • Create a data retention policy with an integer-based time column:
  • Create a data retention policy to discard chunks created before 6 months:
    When you call drop_created_before, s created 3 months ago are selected.

Arguments

The syntax is:
You specify drop_after differently depending on the time column type:
  • TIMESTAMP, TIMESTAMPTZ, and DATE time columns: the time interval should be an INTERVAL type.
  • Integer-based timestamps: the time interval should be an integer type. You must set the integer_now_func.

Returns