Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mnV4U-0003Yh-9I for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Nov 2021 00:14:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mnV4S-0002dg-Po for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Nov 2021 00:14:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mnV4S-0002dX-GF for pgsql-hackers@lists.postgresql.org; Thu, 18 Nov 2021 00:14:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mnV4Q-0008LH-2Y for pgsql-hackers@lists.postgresql.org; Thu, 18 Nov 2021 00:14:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1AI0ES732850853; Wed, 17 Nov 2021 19:14:28 -0500 From: Tom Lane To: "Bossart, Nathan" cc: "pgsql-hackers@lists.postgresql.org" Subject: Re: Improving psql's \password command In-reply-to: References: <747443.1635536754@sss.pgh.pa.us> <765509.1635552418@sss.pgh.pa.us> <7BAC8A28-148B-4B03-A345-D68071388300@amazon.com> <1553329.1636647111@sss.pgh.pa.us> <1847699.1636747076@sss.pgh.pa.us> <2141902.1636999964@sss.pgh.pa.us> <5EDA38EF-C411-4C7D-A9BC-10B1D4584E5E@amazon.com> <2152988.1637010233@sss.pgh.pa.us> Comments: In-reply-to "Bossart, Nathan" message dated "Mon, 15 Nov 2021 21:52:42 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2850851.1637194468.1@sss.pgh.pa.us> Date: Wed, 17 Nov 2021 19:14:28 -0500 Message-ID: <2850852.1637194468@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Bossart, Nathan" writes: > You are right. I'm not sure what I was thinking. Attached a v3 > with that part removed. Pushed with a little further tweaking --- mostly, I felt that explicitly referring to SIGINT in the API names was too implementation-specific, so I renamed things. As you mentioned, there are several other simple_prompt() calls that could usefully be improved. (I think the one in startup.c may be OK because we've not set up the SIGINT handler yet, though.) I wondered whether it's worth refactoring some more to have just one function that sets up the context mechanism. I was also of two minds about whether to add a context option to pg_get_line_buf(). I stuck with your choice not to, but it does look a bit inconsistent. regards, tom lane