From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: stan <stanb@panix.com>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Isolation of multiple databse instances provided by a single postgres server
Date: Thu, 21 Nov 2019 07:21:10 -0800
Message-ID: <5c065b95-9f53-116c-1f23-2800eeeca744@aklaver.com> (raw)
In-Reply-To: <a5574835b147c2ba0d9d5d5891e8eae6b9e081f9.camel@cybertec.at>
References: <20191120220353.GA24554@panix.com>
<db8bd3e1-7217-a66d-6113-2f402d89801c@gmail.com>
<20191121115549.GA3417@panix.com>
<a5574835b147c2ba0d9d5d5891e8eae6b9e081f9.camel@cybertec.at>
On 11/21/19 6:51 AM, Laurenz Albe wrote:
> On Thu, 2019-11-21 at 06:55 -0500, stan wrote:
> You can use tablespaces in PostgreSQL, which are directories on a
> different file system, to put your data elsewhere.
> But that has very limited use-cases, and normally you don't
> create a tablespace.
>
> About isolation:
> - The different databases in a cluster are physically located in
> the same tablespace, but they are logically strictly separated.
> You cannot connect to one database and access another database from there.
dblink(https://www.postgresql.org/docs/11/dblink.html) and
FDW(https://www.postgresql.org/docs/11/sql-createforeigntable.html)
would beg to differ.
>
> - There can be several schemas in a database.
There are several schemas in a database. In a new database:
test=# \dnS
List of schemas
Name | Owner
--------------------+----------
information_schema | postgres
pg_catalog | postgres
pg_temp_1 | postgres
pg_toast | postgres
pg_toast_temp_1 | postgres
public | postgres
> You can access a table in a schema if you have the required privilege
> on both the schema and the table.
>
> This is entirely independent of physical storage, which is provided
> by tablespaces. Tables from different databases can be located in the
> same tablespace and vice versa.
>
> Think of "database" and "schema" as a logical separation in SQL.
>
> You cannot backup and restore an individual tablespace, only the
> whole cluster.
>
> Yours,
> Laurenz Albe
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, laurenz.albe@cybertec.at, stanb@panix.com, ronljohnsonjr@gmail.com
Subject: Re: Isolation of multiple databse instances provided by a single postgres server
In-Reply-To: <5c065b95-9f53-116c-1f23-2800eeeca744@aklaver.com>
References: <20191120220353.GA24554@panix.com> <db8bd3e1-7217-a66d-6113-2f402d89801c@gmail.com> <20191121115549.GA3417@panix.com> <a5574835b147c2ba0d9d5d5891e8eae6b9e081f9.camel@cybertec.at> <5c065b95-9f53-116c-1f23-2800eeeca744@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox