Question

Can I have multiple data directories?

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?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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