Re: schema or database - Mailing list pgsql-general

From Albe Laurenz
Subject Re: schema or database
Date
Msg-id A737B7A37273E048B164557ADEF4A58B365CC78D@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to schema or database  (Michael Cheung <vividy@justware.co.jp>)
Responses Re: schema or database
List pgsql-general
Michael Cheung wrote:
> I have many similar database to store data for every customer.
> Structure of database is almost the same.
> As I use same application to control all these data, so I can only use
> one database user to connect to these database.
> And I have no needs to query table for different customer together.
> 
> I wonder which I should use, different shema or different database to store data?
> 
> I 'd like to know the advantage and disadvantage for using schema or database.

In addition to what others have said:

If you use multiple schemas within one database, the danger is greater that
data are written to or read from the wrong schema if your application has a bug
ans does not make sure to always set search_path or qualify every access with a
schema name.

With multiple databases you are guaranteed not to access data from a different
database.

The main downside that I see to multiple databases is the overhead: each of
the databases will have its own pg_catalog tables.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Limiting user from changing its own attributes
Next
From: Pavel Stehule
Date:
Subject: Re: schema or database