From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Jobin Augustine <jobinau@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: libpq parameter parsing problem
Date: Tue, 7 Jan 2020 15:27:08 +0200
Message-ID: <38896fd5-afe9-6922-0034-63d32a04cbcf@iki.fi> (raw)
In-Reply-To: <CANaTPsrYgSgE2fuj3=4x=Jmx1c+NgkEDzftNknZbrMuqL+aBhQ@mail.gmail.com>
References: <CANaTPsrYgSgE2fuj3=4x=Jmx1c+NgkEDzftNknZbrMuqL+aBhQ@mail.gmail.com>
On 07/01/2020 15:17, Jobin Augustine wrote:
> Hello hackers,
> User can pass session-level settings as a parameter in the connection
> string like:
> psql "host=localhost user=postgres options='-c synchronous_commit=off'"
> Which sets the synchronous_commit off for the session.
>
> However, URI spec is not allowing it,
> psql postgresql://postgres@localhost:5432/postgres?options="-c
> synchronous_commit=off"
> psql: error: could not connect to server: extra key/value separator "="
> in URI query parameter: "options"
The "-c synchronous_commit=off" string is part of the value for the
"options" keyword. So it needs to be URI encoded:
psql
"postgresql://postgres@localhost:5432/postgres?options=-c%20synchronous_commit%3Doff"
- Heikki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: hlinnaka@iki.fi, jobinau@gmail.com
Subject: Re: libpq parameter parsing problem
In-Reply-To: <38896fd5-afe9-6922-0034-63d32a04cbcf@iki.fi>
References: <CANaTPsrYgSgE2fuj3=4x=Jmx1c+NgkEDzftNknZbrMuqL+aBhQ@mail.gmail.com> <38896fd5-afe9-6922-0034-63d32a04cbcf@iki.fi>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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