Rick Schumeyer wrote:
I'm developing an application that will be used by several independent customers. Conceptually, the data from one customer has no relation at all to another customer. In fact, each customer's data is private, and you would never combine data from different customers.
Michael Glaesemann wrote:
Unless the database schema is shared by the different customers, I'd set up a separate database for each. There's better security with separate databases, and since different customer's data would never be combined, there's no advantage to putting them in the same one. Per database overhead is probably going to be negligible compared to the infrastructure you'd want to put in place for security.
I am always confused by the overloaded term "database" in such discussions. Do we mean the RDBMS engine, i.e., run separate instances of PG? I sure would recommend against that. Or do we mean it as the PG documentation does, e.g.,
<http://www.postgresql.org/docs/8.1/interactive/ddl-schemas.html>
A PostgreSQL database cluster contains one or more named databases. Users and groups of users are shared across the entire cluster, but no other data is shared across databases. Any given client connection to the server can access only the data in a single database, the one specified in the connection request.
That seems to be PostgreSQL's answer to the OP's question.
Note: Users of a cluster do not necessarily have the privilege to access every database in the cluster. Sharing of user names means that there cannot be different users named, say, joe in two databases in the same cluster; but the system can be configured to allow joe access to only some of the databases.
In the OP's case, "some of the databases" is "one of the databases". -- Lew