Re: PostgreSQL URI

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL URI
Date: 2021-02-25 15:43:03
Message-ID: 128981.1614267783@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?utf-8?Q?Paul_F=C3=B6rster?= <paul(dot)foerster(at)gmail(dot)com> writes:
>> On 25. Feb, 2021, at 16:22, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Hmm. Maybe
>> postgresql://[user[:password](at)][host[:port][,...]][/dbname][?param1=value1&...]
>> ? 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](at)][[host][:port][,...]][/dbname][?param1=value1&...]

but I'm less sure that that's an improvement.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Brison 2021-02-25 15:45:55 Re: Extension intarray and null values
Previous Message Roman Liverovskiy 2021-02-25 15:40:23 Re: Server hangs on pg_repack