public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Identify system databases
3+ messages / 3 participants
[nested] [flat]

* Re: Identify system databases
@ 2025-04-15 15:07 Adrian Klaver <[email protected]>
  2025-04-15 16:21 ` Fwd: Identify system databases Igor Korot <[email protected]>
  2025-04-15 16:29 ` Re: Identify system databases Tom Lane <[email protected]>
  0 siblings, 2 replies; 3+ messages in thread

From: Adrian Klaver @ 2025-04-15 15:07 UTC (permalink / raw)
  To: Igor Korot <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

On 4/15/25 07:48, Igor Korot wrote:
> Hi, ALL,
> Is there a field in the pg_databases table which indicates that 
> particular DB is a system one?

No there is not. As a practical matter they are no different then any 
user created database, other then template0 is created with datallowconn 
  set to false.

> 
> Or it can be determined ony by name?
> 
> Thank you.
> 

-- 
Adrian Klaver
[email protected]







^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Fwd: Identify system databases
  2025-04-15 15:07 Re: Identify system databases Adrian Klaver <[email protected]>
@ 2025-04-15 16:21 ` Igor Korot <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: Igor Korot @ 2025-04-15 16:21 UTC (permalink / raw)
  To: pgsql-generallists.postgresql.org <[email protected]>

---------- Forwarded message ---------
From: Igor Korot <[email protected]>
Date: Tue, Apr 15, 2025 at 11:16 AM
Subject: Re: Identify system databases
To: Adrian Klaver <[email protected]>


Hi, Adrian,

On Tue, Apr 15, 2025 at 10:07 AM Adrian Klaver <[email protected]>
wrote:

> On 4/15/25 07:48, Igor Korot wrote:
> > Hi, ALL,
> > Is there a field in the pg_databases table which indicates that
> > particular DB is a system one?
>
> No there is not. As a practical matter they are no different then any
> user created database, other then template0 is created with datallowconn
>   set to false.


Understood. Will filter by name…

Thank you.


>
> >
> > Or it can be determined ony by name?
> >
> > Thank you.
> >
>
> --
> Adrian Klaver
> [email protected]
>
>


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Identify system databases
  2025-04-15 15:07 Re: Identify system databases Adrian Klaver <[email protected]>
@ 2025-04-15 16:29 ` Tom Lane <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2025-04-15 16:29 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; +Cc: Igor Korot <[email protected]>; pgsql-generallists.postgresql.org <[email protected]>

Adrian Klaver <[email protected]> writes:
> On 4/15/25 07:48, Igor Korot wrote:
>> Is there a field in the pg_databases table which indicates that 
>> particular DB is a system one?

> No there is not. As a practical matter they are no different then any 
> user created database, other then template0 is created with datallowconn 
>   set to false.

Yeah; in a very real sense there isn't such a thing as a "system
database" in Postgres.  There are pre-created databases that have
specific uses (such as being the default template for CREATE
DATABASE), but those uses are identified by name not by OID.
You can drop template1, and the only thing that will be unhappy
is CREATE DATABASE, and if you make a new DB that is named
template1 then CREATE DATABASE will be happy again.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-04-15 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-04-15 15:07 Re: Identify system databases Adrian Klaver <[email protected]>
2025-04-15 16:21 ` Igor Korot <[email protected]>
2025-04-15 16:29 ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox