spock.cleanup_resolutions
The upstream Spock manual covers 6.0.0-beta.2 and includes 5.0 maintenance notes. For deployment, configuration and recovery on Mimus, use Spock 5.0.15.
The spock.cleanup_resolutions() function manually deletes old rows from the
spock.resolutions table.
Synopsis
Description
Deletes rows from spock.resolutions whose log_time is older than the
retention window. Returns the number of rows deleted.
This function is a superuser-only manual trigger for the same cleanup that
the apply worker runs automatically once per day. It is useful for
immediate cleanup via pg_cron or when the apply worker has not been
running.
When days is provided it takes precedence over
spock.resolutions_retention_days, including when the GUC is set to 0
(automatic cleanup disabled). If days is omitted, the GUC value is used;
if the GUC is also 0, the function returns 0 without deleting anything.
Arguments
The function accepts the following argument:
days- Retention window in days. Overridesspock.resolutions_retention_daysfor this call. Pass an explicit value to perform a one-off cleanup when automatic cleanup is disabled (resolutions_retention_days = 0). Default isNULL(use the GUC value).
Example
Delete rows older than the configured retention window:
Delete rows older than 60 days, regardless of the GUC setting:
See Also
spock.resolutions_retention_days
Upstream source · d05e2e2b6a82 · Copyright (c) 2021–2026, pgEdge, Inc.; portions Copyright the PostgreSQL Global Development Group and The Regents of the University of California. PostgreSQL License.