Re: Fwd: Identify system databases

2025-04-16 Thread Laurenz Albe
On Wed, 2025-04-16 at 17:06 +0200, Dominique Devienne wrote: > So in a way, you guys are saying one should never REVOKE CONNECT ON > DATABASE FROM PUBLIC? No, not at all. > All my DBs are not PUBLIC-accessible. > And inside my DBs, I try to revoke everything from PUBLIC > (USAGE ON TYPES, EXECUTE

Re: Fwd: Identify system databases

2025-04-16 Thread Tom Lane
"David G. Johnston" writes: > But feel free to work out a design and add it to the ToDo list for the v4 > protocol. The use case seems reasonable and doable (on the basis of the > replication protocol works). No, the replication protocol isn't a precedent. Physical replication needn't connect t

Re: Fwd: Identify system databases

2025-04-16 Thread David G. Johnston
On Wed, Apr 16, 2025 at 8:07 AM Dominique Devienne wrote: > On Wed, Apr 16, 2025 at 4:39 PM Tom Lane wrote: > > Laurenz Albe writes: > > > On Wed, 2025-04-16 at 10:09 +0200, Dominique Devienne wrote: > > So in a way, you guys are saying one should never REVOKE CONNECT ON > DATABASE FROM PUBLIC?

Re: Fwd: Identify system databases

2025-04-16 Thread Dominique Devienne
On Wed, Apr 16, 2025 at 4:39 PM Tom Lane wrote: > Laurenz Albe writes: > > On Wed, 2025-04-16 at 10:09 +0200, Dominique Devienne wrote: So in a way, you guys are saying one should never REVOKE CONNECT ON DATABASE FROM PUBLIC? All my DBs are not PUBLIC-accessible. And inside my DBs, I try to rev

Re: Fwd: Identify system databases

2025-04-16 Thread Tom Lane
Laurenz Albe writes: > On Wed, 2025-04-16 at 10:09 +0200, Dominique Devienne wrote: >> Authentication is cluster-wide, not DB specific, so I'd welcome a way to >> connect >> to the cluster, not a specific DB, and introspect shared-objects, >> including databases >> I'm allowed to connect to, whic

Re: Fwd: Identify system databases

2025-04-16 Thread Laurenz Albe
On Wed, 2025-04-16 at 10:09 +0200, Dominique Devienne wrote: > On Wed, Apr 16, 2025 at 9:32 AM Laurenz Albe wrote: > > On Tue, 2025-04-15 at 17:24 -0700, Adrian Klaver wrote: > > But then you fortunately cannot drop all databases, because you cannot > > drop the database you are connected to. > >

Re: Fwd: Identify system databases

2025-04-16 Thread Dominique Devienne
On Wed, Apr 16, 2025 at 9:32 AM Laurenz Albe wrote: > On Tue, 2025-04-15 at 17:24 -0700, Adrian Klaver wrote: > But then you fortunately cannot drop all databases, because you cannot > drop the database you are connected to. > > Still, a cluster that is missing "postgres" will give beginners troub

Re: Fwd: Identify system databases

2025-04-16 Thread Laurenz Albe
On Tue, 2025-04-15 at 17:24 -0700, Adrian Klaver wrote: > I know I can use --template=template with createdb, but that still means > there has to be a database existing in the initial cluster to use as a > template. You can't get around that fact. Right. But then you fortunately cannot drop all

Re: Fwd: Identify system databases

2025-04-15 Thread David G. Johnston
On Tue, Apr 15, 2025 at 5:24 PM Adrian Klaver wrote: > > > > By creating the initial three databases the system is more usable due to > > having established conventions. They are conventional databases, not > > system ones. > > The bottom line is the Postgres project has built an infrastructure

Re: Fwd: Identify system databases

2025-04-15 Thread Adrian Klaver
On 4/15/25 11:35, David G. Johnston wrote: On Tue, Apr 15, 2025 at 11:20 AM Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: 1) Try connecting(not using single user mode) to a cluster without them. First I have had this discussion before and was not successful and I expect the

Re: Fwd: Identify system databases

2025-04-15 Thread Ron Johnson
On Tue, Apr 15, 2025 at 3:11 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Tue, Apr 15, 2025 at 11:20 AM Adrian Klaver < > adrian.kla...@aklaver.com> > > wrote: > >> If what you say is true why does initdb lack an option to not create > >> them on creating a cluster? > > > By creating

Re: Fwd: Identify system databases

2025-04-15 Thread Tom Lane
"David G. Johnston" writes: > On Tue, Apr 15, 2025 at 11:20 AM Adrian Klaver > wrote: >> If what you say is true why does initdb lack an option to not create >> them on creating a cluster? > By creating the initial three databases the system is more usable due to > having established conventions

Re: Fwd: Identify system databases

2025-04-15 Thread David G. Johnston
On Tue, Apr 15, 2025 at 11:20 AM Adrian Klaver wrote: > On 4/15/25 09:48, David G. Johnston wrote: > > On Tue, Apr 15, 2025 at 9:31 AM Adrian Klaver > > wrote: > > > > > > > Agreed. > > > > The fact that initdb creates the template0, template1 and postgr

Re: Fwd: Identify system databases

2025-04-15 Thread Adrian Klaver
On 4/15/25 09:48, David G. Johnston wrote: On Tue, Apr 15, 2025 at 9:31 AM Adrian Klaver > wrote: Agreed. The fact that initdb creates the template0, template1 and postgres databases and you can't change that makes them system not user datab

Re: Fwd: Identify system databases

2025-04-15 Thread David G. Johnston
On Tue, Apr 15, 2025 at 9:31 AM Adrian Klaver wrote: > On 4/15/25 09:21, Igor Korot wrote: > > > > > > > Hi, David, > > > > On Tue, Apr 15, 2025 at 9:56 AM David G. Johnston > > mailto:david.g.johns...@gmail.com>> wrote: > > > > On Tuesday, April 15, 2025, Igor Korot >

Re: Fwd: Identify system databases

2025-04-15 Thread Adrian Klaver
On 4/15/25 09:21, Igor Korot wrote: Hi, David, On Tue, Apr 15, 2025 at 9:56 AM David G. Johnston mailto:david.g.johns...@gmail.com>> wrote: On Tuesday, April 15, 2025, Igor Korot mailto:ikoro...@gmail.com>> wrote: Hi, ALL, Is there a field in the pg_databases table w

Re: Identify system databases

2025-04-15 Thread Tom Lane
Adrian Klaver 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

Fwd: Identify system databases

2025-04-15 Thread Igor Korot
-- Forwarded message - From: Igor Korot Date: Tue, Apr 15, 2025 at 11:16 AM Subject: Re: Identify system databases To: Adrian Klaver Hi, Adrian, On Tue, Apr 15, 2025 at 10:07 AM Adrian Klaver wrote: > On 4/15/25 07:48, Igor Korot wrote: > > Hi, ALL, > > Is t

Fwd: Identify system databases

2025-04-15 Thread Igor Korot
-- Forwarded message - From: Igor Korot Date: Tue, Apr 15, 2025 at 11:15 AM Subject: Re: Identify system databases To: David G. Johnston Hi, David, On Tue, Apr 15, 2025 at 9:56 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tuesday, April 15, 2025, I

Re: Identify system databases

2025-04-15 Thread Adrian Klaver
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 f

Re: Identify system databases

2025-04-15 Thread David G. Johnston
On Tuesday, April 15, 2025, Igor Korot 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? David J.

Identify system databases

2025-04-15 Thread Igor Korot
Hi, ALL, Is there a field in the pg_databases table which indicates that particular DB is a system one? Or it can be determined ony by name? Thank you.