public inbox for [email protected]
help / color / mirror / Atom feedFrom: Adrian Klaver <[email protected]>
To: Igor Korot <[email protected]>
To: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: Fwd: Identify system databases
Date: Tue, 15 Apr 2025 09:30:56 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+FnnTyWMXPEVAwNNDnCVDfmTFNHdDfffiF5vLioxyTv8Jmq0A@mail.gmail.com>
References: <CA+FnnTxab=JyE0DZkfL4Z2MK8RvvTud9MZiNenD45AoV_t2Mxg@mail.gmail.com>
<CAKFQuwYaDXuuDoEaad5sYW97pRS_FJnmfZCwY3FojnDOdfXc9Q@mail.gmail.com>
<CA+FnnTzwmMTNymgPuiF4CLfa6YO+HBRx4Qy5_B_KDw1oNpiukw@mail.gmail.com>
<CA+FnnTyWMXPEVAwNNDnCVDfmTFNHdDfffiF5vLioxyTv8Jmq0A@mail.gmail.com>
On 4/15/25 09:21, Igor Korot wrote:
>
>
> Hi, David,
>
> On Tue, Apr 15, 2025 at 9:56 AM David G. Johnston
> <[email protected] <mailto:[email protected]>> wrote:
>
> On Tuesday, April 15, 2025, Igor Korot <[email protected]
> <mailto:[email protected]>> wrote:
>
> Hi, ALL,
> Is there a field in the pg_databases table which indicates that
> particular DB is a system one?
>
>
> What is a system database?
>
>
> I consider system database a database that is created by default when
> the server is run for the first time.
Agreed.
The fact that initdb creates the template0, template1 and postgres
databases and you can't change that makes them system not user databases.
Further from here:
https://www.postgresql.org/docs/devel/app-initdb.html
"The postgres database is a default database meant for use by users,
utilities and third party applications"
indicates that postgres is expected to be in a cluster(system).
Lastly the CREATE DATABASE depends on template1 to be there to create at
least the first user database. Also template0 is a "clean" template
database that allows for using a new encoding in new database. It is
also used by pg_dump/restore:
CREATE DATABASE test WITH TEMPLATE = template0 ...
>
> Kind of a predefined set of databases…
>
> As an example - there is a database called Postgres. It is created when
> the server runs for the first time, whether I as a user like it or not.
>
> Thank you.
>
>
> David J.
>
--
Adrian Klaver
[email protected]
view thread (4+ messages) latest in thread
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Fwd: Identify system databases
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox