minor issue: \c without parameter disconnect current user

Started by Pavel Stehuleover 9 years ago5 messageshackers
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hi

I expect so \c without parameters has only informational character. But \c
reset user.

postgres=# set role to tom;
SET
Time: 0.787 ms
postgres=> select current_user;
+--------------+
| current_user |
+--------------+
| tom |
+--------------+
(1 row)

Time: 0.851 ms
postgres=> \c
You are now connected to database "postgres" as user "pavel".
postgres=# select current_user;
+--------------+
| current_user |
+--------------+
| pavel |
+--------------+
(1 row)

Regards

Pavel

#2Robert Haas
robertmhaas@gmail.com
In reply to: Pavel Stehule (#1)
Re: minor issue: \c without parameter disconnect current user

On Mon, Oct 17, 2016 at 12:49 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

I expect so \c without parameters has only informational character. But \c
reset user.

Yeah, I use that feature all the time.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Robert Haas (#2)
Re: minor issue: \c without parameter disconnect current user

Robert Haas wrote:

On Mon, Oct 17, 2016 at 12:49 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

I expect so \c without parameters has only informational character. But \c
reset user.

Yeah, I use that feature all the time.

And so do the regression tests.

I think what Pavel wants is \conninfo.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#3)
Re: minor issue: \c without parameter disconnect current user

Alvaro Herrera <alvherre@2ndquadrant.com> writes:

Robert Haas wrote:

On Mon, Oct 17, 2016 at 12:49 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

I expect so \c without parameters has only informational character. But \c
reset user.

Yeah, I use that feature all the time.

And so do the regression tests.

pg_dump relies on it too, I think.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Pavel Stehule
pavel.stehule@gmail.com
In reply to: Alvaro Herrera (#3)
Re: minor issue: \c without parameter disconnect current user

2016-10-18 20:11 GMT+02:00 Alvaro Herrera <alvherre@2ndquadrant.com>:

Robert Haas wrote:

On Mon, Oct 17, 2016 at 12:49 AM, Pavel Stehule <pavel.stehule@gmail.com>

wrote:

I expect so \c without parameters has only informational character.

But \c

reset user.

Yeah, I use that feature all the time.

And so do the regression tests.

I think what Pavel wants is \conninfo.

yes - still something can new for me :)

Pavel

Show quoted text

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services