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 1lFInH-0000Uu-BJ for pgsql-general@arkaria.postgresql.org; Thu, 25 Feb 2021 15:43:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lFInE-0005HG-GU for pgsql-general@arkaria.postgresql.org; Thu, 25 Feb 2021 15:43:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFInE-0005H9-8i for pgsql-general@lists.postgresql.org; Thu, 25 Feb 2021 15:43:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFInC-0004C7-Ad for pgsql-general@lists.postgresql.org; Thu, 25 Feb 2021 15:43:07 +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 11PFh3Kq128982; Thu, 25 Feb 2021 10:43:03 -0500 From: Tom Lane To: =?utf-8?Q?Paul_F=C3=B6rster?= cc: pgsql-general list Subject: Re: PostgreSQL URI In-reply-to: <0B622B94-DF71-40A6-974B-0262D8C6E2EE@gmail.com> References: <6E752D6B-487C-463E-B6E2-C32E7FB007EA@gmail.com> <109141.1614265768@sss.pgh.pa.us> <119975.1614266568@sss.pgh.pa.us> <0B622B94-DF71-40A6-974B-0262D8C6E2EE@gmail.com> Comments: In-reply-to =?utf-8?Q?Paul_F=C3=B6rster?= message dated "Thu, 25 Feb 2021 16:24:30 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <128980.1614267783.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 25 Feb 2021 10:43:03 -0500 Message-ID: <128981.1614267783@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?utf-8?Q?Paul_F=3DC3=3DB6rster?=3D writes: >> On 25. Feb, 2021, at 16:22, Tom Lane wrote: >> Hmm. Maybe >> postgresql://[user[:password]@][host[:port][,...]][/dbname][?param1=3Dv= alue1&...] >> ? Seems like that would clarify how much you can repeat. > yes, that looks better, thanks. Experimenting, it does let you omit the host and specify a port: $ psql -d postgresql://:5433 psql: error: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5433"? So the original syntax diagram is not wrong. We could add brackets to clarify the repeatable part: postgresql://[user[:password]@][[host][:port][,...]][/dbname][?param1=3Dva= lue1&...] but I'm less sure that that's an improvement. regards, tom lane