Search code examples
databasepostgresqlgoogle-cloud-platformgoogle-bigquerygoogle-cloud-sql

How to decrease storage size for PostgreSQL on Google Cloud?


I moved some of my data from PostgreSQL to BigQuery.

Before PostgreSQL database was using 130 GB of storage, now I only need 30GB.

However, in the Google Cloud Console GUI, I still see that PostgreSQL still allocating 130 GB of storage, while 100GB of it is empty (see the attached screenshot).

Does it mean that Google Cloud is still charging me for 130GB of storage? What can I do to get rid of that unused storage space?

Screenshot from Google Cloud


Solution

  • It is currently impossible to reduce the storage capacity of a Cloud SQL instance. The storage allocation is permanent and cannot reduce only increased. However, there is a feature request for reducing the capacity of a Cloud SQL instance that is worth following for future updates.

    To use a smaller storage capacity, export data as an SQL dump file and then, configure a new Cloud SQL instance with the desired capacity. Then import the SQL dump file to store all your data in the new instance. To achieve efficient and less expensive imports/exports follow these best practices from the documentation.