libpq parameter parsing problem

From: Jobin Augustine <jobinau(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: libpq parameter parsing problem
Date: 2020-01-07 13:17:06
Message-ID: CANaTPsrYgSgE2fuj3=4x=Jmx1c+NgkEDzftNknZbrMuqL+aBhQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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(at)localhost:5432/postgres?options="-c
synchronous_commit=off"
psql: error: could not connect to server: extra key/value separator "=" in
URI query parameter: "options"

psql postgresql://postgres(at)localhost:5432/postgres?options="-c
synchronous_commit off"
psql: error: could not connect to server: FATAL: -c synchronous_commit
requires a value

Moreover session just hangs forever:
psql postgresql://postgres(at)localhost:5432/postgres?application_name=hello&options='-c
synchronous_commit=off'
provided that the connection works without the 'options' parameter
specification

Thanks and regards,
Jobin.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2020-01-07 13:27:08 Re: libpq parameter parsing problem
Previous Message Tom Lane 2020-01-07 12:41:40 Re: About postgresql pg_advisory_xact_lock use!!!!