Postgresql – What’s the difference between betwwen 2 DB and 2 Schema

postgresql-9.2tablespaces

My question is : what is the difference between the two next mode in PostgreSQL, for an production application.

  • using two DB in the same SGBD (the same table-space and HDD)
  • Or using two schema in the same DB

What about response time & performance ?

Best Answer

By default, PostgreSQL's databases cannot see each other and you cannot query between them.

You can query between, or have foreign keys between PostgreSQL schemas.

If you want strong multi-tenant client segregation, use distinct databases.