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 1m4S4h-0007eV-OO for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Jul 2021 17:56:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m4S4g-0003mk-N2 for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Jul 2021 17:56:34 +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 1m4S4g-0003mb-GO for pgsql-bugs@lists.postgresql.org; Fri, 16 Jul 2021 17:56:34 +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 1m4S4b-0005Ua-AK for pgsql-bugs@lists.postgresql.org; Fri, 16 Jul 2021 17:56:33 +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 16GHuNG63745705; Fri, 16 Jul 2021 13:56:23 -0400 From: Tom Lane To: Japin Li cc: bernaridho@outlook.co.id, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17111: Database created, cannot be created, but reported as inexist In-reply-to: References: <17111-c66d4212978a0260@postgresql.org> Comments: In-reply-to Japin Li message dated "Fri, 16 Jul 2021 18:50:57 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3745703.1626458183.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 16 Jul 2021 13:56:23 -0400 Message-ID: <3745704.1626458183@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Japin Li writes: > Can we remove the code for compatibility with 7.2 or older? I'm kind of inclined not to, because most other ways that you can specify a database name for a connection also don't downcase. $ psql Postgres psql: error: connection to server on socket "/tmp/.s.PGSQL.5440" failed: F= ATAL: database "Postgres" does not exist $ psql postgres ... postgres=3D# \c "dbname=3DPostgres" connection to server on socket "/tmp/.s.PGSQL.5440" failed: FATAL: databa= se "Postgres" does not exist Previous connection kept This largely stems from an ancient decision that we shouldn't auto-downcase names coming from a program's command line. The interaction of SQL and shell quoting conventions is messy enough that specifying a non-lower-case database, user, etc name would be pretty annoying if we did do that. regards, tom lane