Re: List user databases

From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Igor Korot <ikorot01(at)gmail(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: List user databases
Date: 2022-11-10 06:25:12
Message-ID: CAB8KJ=jf=_Uyp-GfbuGteXCTzy8C8CoN_XtfXood1NgX7y9tFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2022年11月10日(木) 14:16 Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>:
>
> On 11/9/22 20:57, Ian Lawrence Barwick wrote:
> > 2022年11月10日(木) 13:41 Igor Korot <ikorot01(at)gmail(dot)com>:
> >>
> >> Hi, ALL,
> >> According to https://chartio.com/resources/tutorials/how-to-list-databases-and-tables-in-postgresql-using-psql/,
> >> there are generally 3 system DBs.
> >>
> >> However I'm confused with the word general.
> >> How many system databases can be made on a PG server?
> >
> > template0 and template1 are the mandatory system databases which
> > cannot be dropped.
>
> Actually that is not strictly true:
>
> https://www.postgresql.org/docs/current/manage-ag-templatedbs.html
>
> "
> Note
>
> template1 and template0 do not have any special status beyond the fact
> that the name template1 is the default source database name for CREATE
> DATABASE. For example, one could drop template1 and recreate it from
> template0 without any ill effects. This course of action might be
> advisable if one has carelessly added a bunch of junk in template1. (To
> delete template1, it must have pg_database.datistemplate = false.)

OK, "cannot be dropped unless you manually convert them into non-template
databases" :).

Regards

Ian Barwick

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Julien Rouhaud 2022-11-10 08:33:22 Re: Q: documentation improvement re collation version mismatch
Previous Message Bryn Llewellyn 2022-11-10 06:13:40 Re: "set role" semantics