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

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 16:04:14
Message-ID: 20180813160414.lojhxm7uhqpqeroh@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 13, 2018 at 10:00:56AM -0400, Tom Lane wrote:
> 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 precisely what I'm looking for.

> 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.

I think that passing all-but-password would be good enough.

At the very least for my usecases, as I tend to use pgpass and other
non-interactive authentications.

Best regards,

depesz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2018-08-13 16:04:38 Re: How to get connection details from psql -> \e
Previous Message Tomas Vondra 2018-08-13 15:50:10 Re: Fwd: is there any adverse effect on DB if I set autovacuum scale factor to zero?