I have two databases on postgreSQL. I am running out of disk space and want to move one of my databases to a different directory. How can I do this?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

I believe that you can only have one data directory per PostgreSQL cluster. This answer here explains this quite well:

There can be only one data directory for each PostgreSQL cluster. A cluster is a postmaster listening on a port, managing several databases from a single data directory. You can have multiple clusters by starting multiple postmasters with pg_ctl or via a system service, each listening on a different port and using a different data dir.

If you have multiple clusters on a machine you have multiple data directories. It’s unusual to need to do this, but it is possible.

Source

Regards,
Bobby

Submit an Answer