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 1lFeSg-0001k7-QJ for pgsql-general@arkaria.postgresql.org; Fri, 26 Feb 2021 14:51:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lFeSf-000272-MV for pgsql-general@arkaria.postgresql.org; Fri, 26 Feb 2021 14:51:21 +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 1lFeSf-00026v-Ek for pgsql-general@lists.postgresql.org; Fri, 26 Feb 2021 14:51:21 +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 1lFeSc-0004n2-G9 for pgsql-general@lists.postgresql.org; Fri, 26 Feb 2021 14:51:20 +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 11QEpE6F249147; Fri, 26 Feb 2021 09:51:14 -0500 From: Tom Lane To: Alvaro Herrera cc: Paul =?iso-8859-1?Q?F=F6rster?= , pgsql-general list Subject: Re: PostgreSQL URI In-reply-to: <20210226143050.GA875@alvherre.pgsql> References: <20210226143050.GA875@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Fri, 26 Feb 2021 11:30:50 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <249145.1614351074.1@sss.pgh.pa.us> Date: Fri, 26 Feb 2021 09:51:14 -0500 Message-ID: <249146.1614351074@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > I wonder if we shouldn't instead try to break it up in parts that can be > explained or described separately. This many brackets makes it pretty > hard to read. > We could say something like > postgresql://[userspec@][hostspec][/dbname][?paramspec] > where > userspec is user[:password] > hostspec is [[host][:port]][,...] > paramspec is param1=value1&... +1. I think you could lose the outer brackets in hostspec in this formulation, ie given that hostspec is already bracketed above, it should be enough to write hostspec is [host][:port][,...] Also, the paramspec is under-bracketed today. Should be more like paramspec is param=value[&...] regards, tom lane