Re: How to get connection details from psql -> \e - Mailing list pgsql-general

From Tom Lane
Subject Re: How to get connection details from psql -> \e
Date
Msg-id 17126.1534168856@sss.pgh.pa.us
Whole thread Raw
In response to How to get connection details from psql -> \e  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: How to get connection details from psql -> \e
List pgsql-general
hubert depesz lubaczewski <depesz@depesz.com> writes:
> I'm trying to work on some extension to vim when invoked as \e from
> psql.
> To make it fully work, I need to know connection details that psql was
> using while it invoked \e.

Uh, why?

The only likely reason I can guess at is that you want vim to make its
own connection to the database for some purpose like autocompletion.

That's a cute idea, but from a security standpoint it sounds like a
disaster in the making.  There isn't any secure way to pass down e.g.
a password (neither command line nor environment variables can be
trusted not to be visible to other users), and even if there was
I'm not sure people would be really happy with handing out their
database credentials to any random piece of code psql invokes.

> Is it possible to do in any way, or if not, any chance it could be added
> to wishlist for next versions of Pg?

You'd need to make a case for it that's a lot stronger than "I wish"
before anyone would consider this.

            regards, tom lane


pgsql-general by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: is there any adverse effect on DB if I set autovacuum scalefactor to zero?
Next
From: Adrian Klaver
Date:
Subject: Re: Replication failure, slave requesting old segments