Re: Improving psql's \password command

Nathan Bossart <bossartn@amazon.com>

From: "Bossart, Nathan" <bossartn@amazon.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2021-11-15T21:52:42Z
Lists: pgsql-hackers

Attachments

On 11/15/21, 1:04 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> register.  But really that doesn't matter anyhow, since this
> is a stack level below where the sigsetjmp call is.  AFAIK the
> only longjmp clobber risk is to pg_get_line_append's mutable
> local variables, of which there are none.

*facepalm*

You are right.  I'm not sure what I was thinking.  Attached a v3
with that part removed.

Nathan

Commits

  1. pg_receivewal, pg_recvlogical: allow canceling initial password prompt.

  2. Allow psql's other uses of simple_prompt() to be interrupted by ^C.

  3. Provide a variant of simple_prompt() that can be interrupted by ^C.

  4. Make psql's \password default to CURRENT_USER, not PQuser(conn).