Re: How to get connection details from psql -> \e

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: depesz(at)depesz(dot)com
Cc: pgsql-general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to get connection details from psql -> \e
Date: 2018-08-13 14:00:56
Message-ID: 17126.1534168856@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hubert depesz lubaczewski <depesz(at)depesz(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-08-13 14:06:16 Re: Replication failure, slave requesting old segments
Previous Message Tomas Vondra 2018-08-13 13:59:09 Re: is there any adverse effect on DB if I set autovacuum scale factor to zero?