All Products
Search
Document Center

AnalyticDB:Clear data on a locked AnalyticDB for PostgreSQL instance

Last Updated:Feb 27, 2026

When the disk space of a compute node or coordinator node reaches its limit, the entire AnalyticDB for PostgreSQL instance is locked in a read-only state. To restore write access, free disk space by using TRUNCATE or DROP, and the instance automatically unlocks within about five minutes.

Check whether the instance is locked

Connect to the instance and run the following command:

SHOW rds_force_trans_ro_non_sup;
Note This command requires superuser privileges. If you use a non-superuser account, you may receive the error must be superuser to examine "rds_force_trans_ro_non_sup". In that case, check the instance lock status on the AnalyticDB for PostgreSQL console instead.
ValueMeaning
onThe instance is locked and read-only
offThe instance is not locked

Check table sizes

To identify large tables for cleanup, run the following query:

SELECT pg_size_pretty(pg_total_relation_size('test'));

Replace test with the actual table name.

Clear data to free disk space

While the instance is locked, the following DDL and DCL operations are supported:

  • TRUNCATE -- Remove all rows from a table.

  • DROP -- Delete a table entirely.

  • GRANT -- Modify table permissions.

Use TRUNCATE or DROP on large tables until disk usage falls within the threshold.

Important DELETE is not supported while the instance is locked. DELETE writes transaction data to pg_xlog, which consumes additional disk space.

Verify the instance is unlocked

After disk space falls within the threshold, the instance automatically unlocks within about five minutes. To confirm, re-run the lock status check:

SHOW rds_force_trans_ro_non_sup;

A value of off confirms the instance is no longer locked and write operations are restored.