pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedspecifying multiple options in URI psql behaviour?
4+ messages / 3 participants
[nested] [flat]
* specifying multiple options in URI psql behaviour?
@ 2023-10-02 12:48 Wim Bertels <wim.bertels@ucll.be>
2023-10-02 14:21 ` Re: specifying multiple options in URI psql behaviour? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Wim Bertels @ 2023-10-02 12:48 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Hello,
can anyone confirm this?:
* connections with at most 1 option after the ?-mark sign work:
like
#psql postgresql://myuser@myserver/mydb?connect_timeout=10
or
#psql postgresql://myuser@myserver/mydb?target_session_attrs=any
* but if you put more than 1 option, then it doesn't?:
#psql
postgresql://myuser@myserver/mydb?connect_timeout=10&target_session_att
rs=any
--
https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS
https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
mvg,
Wim
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: specifying multiple options in URI psql behaviour?
2023-10-02 12:48 specifying multiple options in URI psql behaviour? Wim Bertels <wim.bertels@ucll.be>
@ 2023-10-02 14:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-10-02 15:21 ` Re: specifying multiple options in URI psql behaviour? Wim Bertels <wim.bertels@ucll.be>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2023-10-02 14:21 UTC (permalink / raw)
To: Wim Bertels <wim.bertels@ucll.be>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Wim Bertels <wim.bertels@ucll.be> writes:
> * but if you put more than 1 option, then it doesn't?:
> #psql postgresql://myuser@myserver/mydb?connect_timeout=10&target_session_attrs=any
Maybe you forgot to quote that? Ampersand is a shell metacharacter.
(It does seem to work for me, as long as I put quotes around the URL.)
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: specifying multiple options in URI psql behaviour?
2023-10-02 12:48 specifying multiple options in URI psql behaviour? Wim Bertels <wim.bertels@ucll.be>
2023-10-02 14:21 ` Re: specifying multiple options in URI psql behaviour? Tom Lane <tgl@sss.pgh.pa.us>
@ 2023-10-02 15:21 ` Wim Bertels <wim.bertels@ucll.be>
2023-10-03 13:35 ` Re: specifying multiple options in URI psql behaviour? Ron <ronljohnsonjr@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Wim Bertels @ 2023-10-02 15:21 UTC (permalink / raw)
To: tgl@sss.pgh.pa.us <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Tom Lane schreef op ma 02-10-2023 om 10:21 [-0400]:
> Wim Bertels <wim.bertels@ucll.be> writes:
> > * but if you put more than 1 option, then it doesn't?:
>
> > #psql
> > postgresql://myuser@myserver/mydb?connect_timeout=10&target_session
> > _attrs=any
>
> Maybe you forgot to quote that? Ampersand is a shell metacharacter.
yes indeed, & bg and fg, thank you Tom
# psql
'postgresql://myuser@myserver/mydb?connect_timeout=10&target_session_at
trs=any'
or just
# psql
postgresql://myuser@myserver/mydb?connect_timeout=10'&'target_session_a
ttrs=any
>
> (It does seem to work for me, as long as I put quotes around the
> URL.)
>
> regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: specifying multiple options in URI psql behaviour?
2023-10-02 12:48 specifying multiple options in URI psql behaviour? Wim Bertels <wim.bertels@ucll.be>
2023-10-02 14:21 ` Re: specifying multiple options in URI psql behaviour? Tom Lane <tgl@sss.pgh.pa.us>
2023-10-02 15:21 ` Re: specifying multiple options in URI psql behaviour? Wim Bertels <wim.bertels@ucll.be>
@ 2023-10-03 13:35 ` Ron <ronljohnsonjr@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Ron @ 2023-10-03 13:35 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 10/2/23 10:21, Wim Bertels wrote:
> Tom Lane schreef op ma 02-10-2023 om 10:21 [-0400]:
>> Wim Bertels <wim.bertels@ucll.be> writes:
>>> * but if you put more than 1 option, then it doesn't?:
>>> #psql
>>> postgresql://myuser@myserver/mydb?connect_timeout=10&target_session
>>> _attrs=any
>> Maybe you forgot to quote that? Ampersand is a shell metacharacter.
> yes indeed, & bg and fg, thank you Tom
>
> # psql
> 'postgresql://myuser@myserver/mydb?connect_timeout=10&target_session_at
> trs=any'
>
> or just
>
> # psql
> postgresql://myuser@myserver/mydb?connect_timeout=10'&'target_session_a
> ttrs=any
Escaping the & using \ should also work.
--
Born in Arizona, moved to Babylonia.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2023-10-03 13:35 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-10-02 12:48 specifying multiple options in URI psql behaviour? Wim Bertels <wim.bertels@ucll.be>
2023-10-02 14:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-10-02 15:21 ` Wim Bertels <wim.bertels@ucll.be>
2023-10-03 13:35 ` Ron <ronljohnsonjr@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox