Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u51uU-00B3G5-39 for pgsql-general@arkaria.postgresql.org; Wed, 16 Apr 2025 12:30:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u51uS-00Dprr-5K for pgsql-general@arkaria.postgresql.org; Wed, 16 Apr 2025 12:30:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u51uR-00DprV-P8 for pgsql-general@lists.postgresql.org; Wed, 16 Apr 2025 12:30:32 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u51uP-000OHT-0H for pgsql-general@lists.postgresql.org; Wed, 16 Apr 2025 12:30:31 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-ac298c8fa50so1057844666b.1 for ; Wed, 16 Apr 2025 05:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1744806629; x=1745411429; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=Ul1PAifhR6Kq/wShPQNY2aM8a3Xhuvr2o/SGcJuXLak=; b=D9hJfjdGHMu0CJCqbclidHbpHoZyylUh8JmpzzM/RhcXa1BbEXHl1F+gZZGaLMUg+5 Z+4XGNAuhzqelarnSh16EuhdXvpDf7fII6uHU9EH3apuiKblMPLQPY4LVpC18QtLzXHz 9SCfgX6hzIRGp33bPOQ0veaaKelZCiVuNrq3luWPAvb8xc3vMYM50dxOXhZyXHyKgvN1 WssRtooTsF7V/3+bK8O17viI72hlOH+JEQGTveZNgJIgFSfrmRQ1MC2ld0UOTpH+RO// GPip+B6hS/Y+sDRkT3JfUNuxuaBBr7HMwJ/JUx4jqEbVgzIHBEzwU/qTYFJWvMWgNUtV uG0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744806629; x=1745411429; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ul1PAifhR6Kq/wShPQNY2aM8a3Xhuvr2o/SGcJuXLak=; b=p1EV9iPbPtWxKpDnMrlzE2ycr63xWk1dou3FmyhWUb5GZQjN7ElBeqrhTKOeu2OlqT YjVJb1cmwzLzb42eLpvbjQgKAg/3OZNi1GdEiX27GUY1/ZYKaZCCK7lvQP3wIUxmN1/W co3AzOBXBgN6K50BWsWGXA9gKW12hzORmtK0XF1JRDr0KIGZhO9715G0yoLhzyCwSDFD eK6MyjiHXUh3zleLryGQSle+bpRvsJD5WYLjXiEhfF73wZXtrNG3ZXedUvNFhpRasIee u6OiNL0R2o+Q8qygQ7cPM8v6X8NWfEeWhnhMkyk8ipcUgyKGhkDrKXfje52UKjN7TRkg 2r4A== X-Forwarded-Encrypted: i=1; AJvYcCVqwZEIvNLfPIHhEKY3O08mcTPHvmE+IWmsQAjTAdZ04I7otOrVEGdLDpYqy5R9LG8Sal9L3WF0Ymlnd8+t@lists.postgresql.org X-Gm-Message-State: AOJu0Yx4Ikc251Ha4nvqiYvHP/ls0bWW2zCy4f2pZKkg8VRdMk0Y2YJQ d6ec6htEyZwwQE4STIp6gsFpz8o7zUGBcfD1WcSIslDN/INxyg3K1yL4AZt6xM0= X-Gm-Gg: ASbGncu0zDNtX7F7QCiUwywritaP6Uu3hXrsv4BZP9Ifvp7IWfgyHxI5myqLlYIoz9j Ar2vOwN++AmECWtCgEhgebuf6SXgr5oZ2Q+UM/5FkzBLSk1n+CLZ6Qyz93WdZwuLzk19opEqgBv j586CGzH6QnLaI11WEUgXMnbLw5z2LQbGTDjceD3nFEsJCuj8PODyHDiitzloqFCYq2X6O5F99V iRB2k45NETw5BKy+n6JVIbcA6wfAuGYInT2GTriKHnP4tnGxYnMGBelwvyy1OEFgE2Ztyq/AzhV kOfdeb9uZ1lavlva8GzDbHNKNSfqDlZhEB1fWHlx64pW+r0eArhgmx1N0TVgTVL/B1U9BEA= X-Google-Smtp-Source: AGHT+IFq6CDAI36Iqpz4cNcrUYfTKN9xDDDL66iFk8r75bP8kj+K9LOU8sTVUKerw5++nTc8MH+OoA== X-Received: by 2002:a17:907:981:b0:ac3:8aa5:53f6 with SMTP id a640c23a62f3a-acb429dc991mr153221666b.24.1744806628914; Wed, 16 Apr 2025 05:30:28 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:b709:9349:713f:cd9e:e764]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-acb3d1ccdbfsm118236466b.155.2025.04.16.05.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 05:30:28 -0700 (PDT) Message-ID: <2dffe860b085b927726a052bcfe16ede704ab923.camel@cybertec.at> Subject: Re: Fwd: Identify system databases From: Laurenz Albe To: Dominique Devienne Cc: Adrian Klaver , "David G. Johnston" , Igor Korot , "pgsql-generallists.postgresql.org" Date: Wed, 16 Apr 2025 14:30:27 +0200 In-Reply-To: References: <817abeac-d628-4279-bfef-9e1e3aa1884b@aklaver.com> <25b6cd49-f871-47fe-bf3b-5416637736ca@aklaver.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2025-04-16 at 10:09 +0200, Dominique Devienne wrote: > On Wed, Apr 16, 2025 at 9:32=E2=80=AFAM 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. > >=20 > > Still, a cluster that is missing "postgres" will give beginners trouble >=20 > Right. Given shared "cluster-wide" objects like roles, databases, etc... > I'm always found it weird that one must know "a priori" the name of one > database to connect to, to do anything with PostgreSQL. It is documented, and it is the default database if you are connecting with the default database user "postgres", so it is not that bad. Also, tools like "createdb" connect to that database by default. > Not being able to drop the DB one's connected to is also a pita. > If one have the right to do it, then it should just be done, and the > connection closed. No, it is a life saver, at least in my opinion. > 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, which could be an empty list. It is deep in the DNA of PostgreSQL that you always have to connect to a database, unless you establish a replication connection. I am surprised that you perceive that as a problem or limitation. > FWIW. And a little OT. And implicit cluster-level mini-DB given access > just to a subset of catalogs, or at least some limited queries like > my databases and my roles, nothing else, would be very welcome IMHO. --DD Well, that's the "postgres" database. Yours, Laurenz Albe