inheritance of connection paramters when using \c

From: "nagaura(dot)ryohei(at)fujitsu(dot)com" <nagaura(dot)ryohei(at)fujitsu(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: 'Fabien COELHO' <coelho(at)cri(dot)ensmp(dot)fr>
Subject: inheritance of connection paramters when using \c
Date: 2019-06-26 04:14:45
Message-ID: OSAPR01MB39404FBE8678C185C25D273896E20@OSAPR01MB3940.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

\c is followed by [-reuse-previous=on/off] positional syntax | conninfo
Using \c -reuse-previous=on positional syntax or \c positional syntax without -reuse-previous option, some parameters which were omitted or notated as "-" will be reused in the new connection.
The target is only "dbname", "user", "host", "port" in the current implementation.
# details in [1]
When we discussed in [2], this topic came out.
Although I'm not heavy psql user, I want it to inherit connection parameters and Fabien-san does too.

My new specification:
\c inherits all the unspecified connection parameters in PQconninfoOptions in cases below.
a) \c -reuse-previous=on positional syntax
b) \c positional syntax
This is just an expansion of the target of inheritance of parameters from the current specification.

I have an item to talk about.
It is whether the message which indicates connection information to users has to have more information such as
You are now connected to database "TomANDJelly" as user "nyannyan" with some parameters [reused | defaults].
# after "nyannyan"

Do you have any thoughts?

[1] https://www.postgresql.org/docs/12/app-psql.html
[2] https://www.postgresql.org/message-id/flat/EDA4195584F5064680D8130B1CA91C45367328(at)G01JPEXMBYT04
Best regards,
---------------------
Ryohei Nagaura

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-06-26 04:23:08 Re: [patch]socket_timeout in interfaces/libpq
Previous Message nagaura.ryohei@fujitsu.com 2019-06-26 04:13:36 [patch]socket_timeout in interfaces/libpq