Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mC0FH-0005Gv-1M for pgsql-general@arkaria.postgresql.org; Fri, 06 Aug 2021 13:50:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mC0FF-0003M2-76 for pgsql-general@arkaria.postgresql.org; Fri, 06 Aug 2021 13:50:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mC0FE-0003Lu-UB for pgsql-general@lists.postgresql.org; Fri, 06 Aug 2021 13:50:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mC0FC-0004pi-EC for pgsql-general@lists.postgresql.org; Fri, 06 Aug 2021 13:50:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 176DoY1l2477880; Fri, 6 Aug 2021 09:50:35 -0400 From: Tom Lane To: Matthias Apitz cc: Guillaume Lelarge , "pgsql-generallists.postgresql.org" Subject: Re: psql's default database on connect (our internal ref. SRP-30861) In-reply-to: References: Comments: In-reply-to Matthias Apitz message dated "Fri, 06 Aug 2021 09:51:55 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2477878.1628257834.1@sss.pgh.pa.us> Date: Fri, 06 Aug 2021 09:50:34 -0400 Message-ID: <2477879.1628257834@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Matthias Apitz writes: > Sorry, it does not: > testpos@srap53dxr1:~> psql --help -Usisis | grep DBNAME > psql [OPTION]... [DBNAME [USERNAME]] > -d, --dbname=DBNAME database name to connect to (default: "testpos") While that's certainly confusing, I'm not sure it's wrong. I'd interpret "default" as meaning "default if you don't specify something different on the command line". The default username is reported under similar rules: $ psql --help -Ufoo | grep user -U, --username=USERNAME database user name (default: "tgl") In any case, these choices of default have stood for a very long time and we're unlikely to consider changing them. If (some parts of) the docs are inaccurate we should change the docs. regards, tom lane