Storage in Managed Service for PostgreSQL
Warning
Managed Service for PostgreSQL no longer supports disk type selection. The only disk type available for PostgreSQL clusters is network-ssd
(see description).
Managing disk space
When the storage is more than 97% full, the host automatically switches to read-only mode, while all DBs get DEFAULT_TRANSACTION_READ_ONLY
set to TRUE
through the ALTER DATABASE
query.
In this mode, the data INSERT
, DELETE
, or UPDATE
queries result in an error.
Recovering a cluster from read-only mode
If the cluster switched to read-only mode:
-
Increase the storage capacity so that it exceeds the threshold value. Nebius AI will then disable read-only mode automatically.
-
Disable read-only mode manually and free up storage space by deleting some of the data.
Alert
When doing so, make sure the amount of free disk space never reaches zero. Since the fail-safe is disabled, PostgreSQL will crash and the cluster will stop working.
To disable read-only mode manually, contact technical support
-
Connect to the database in any appropriate way.
-
Open a transaction and run the following command inside it:
SET LOCAL transaction_read_only TO off;
-
As part of the same transaction, delete the data you do not need using the
DROP
orTRUNCATE
operators. Do not use theDELETE
operator, as it marks rows as deleted but does not physically delete them from the database. -
Commit the transaction and restart all connections to the database.
For example, if your database contains a table called
ExcessDataTable1
that you no longer need, delete it with the following transaction:
BEGIN; SET LOCAL transaction_read_only TO off; DROP TABLE ExcessDataTable1; COMMIT;