Is it possible to have multiple PostgreSQL instances for one PGDATA folder, shared in a storage for example?

And if is not, is there is some kind of RDBMS capable of something like this?

  • Do you mean multiple databases within a single cluster? Or multiple clusters? If the latter, where does the requirement come from that they share PGDATA directories -- could they share a parent directory that has multiple PGDATA directories in it? – jmelesky Sep 25 '19 at 15:28

No, that is impossible. PostgreSQL protects against that as good as it can, but if you manage to start a second postmaster, instant data corruption will ensue.

This question makes me wonder why you want that:

  • It cannot be scalability, because you have I/O as a bottleneck.
  • It cannot be high availability, because the shared storage is a single point of failure.

Such architectures like Oracle RAC are ill-conceived and mostly useless; nobody would design such a system these days.

The way to go is a shared-nothing cluster like patroni.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.