Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tiIew-00E9SI-RZ for pgsql-general@arkaria.postgresql.org; Wed, 12 Feb 2025 19:44:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tiIeu-00D6uA-RF for pgsql-general@arkaria.postgresql.org; Wed, 12 Feb 2025 19:44:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tiIeu-00D6oZ-GO for pgsql-general@lists.postgresql.org; Wed, 12 Feb 2025 19:44:33 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tiIet-000SMz-0P for pgsql-general@postgresql.org; Wed, 12 Feb 2025 19:44:32 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 2BF6F2A14D6 for ; Wed, 12 Feb 2025 11:44:29 -0800 (PST) Date: Wed, 12 Feb 2025 11:44:29 -0800 (PST) From: Rich Shepard To: pgsql-general Subject: Re: psql command line editing In-Reply-To: <3370941.1739388555@sss.pgh.pa.us> Message-ID: <40bef2b1-62a1-ed-63c0-6487bbcdd133@appl-ecosys.com> References: <61255ab-6249-1226-7db6-4ecc3e4c127b@appl-ecosys.com> <3370941.1739388555@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 12 Feb 2025, Tom Lane wrote: > On my machine, Ctrl-Left/Right don't seem to do anything, but the usual > Emacs combinations Ctrl-A, Ctrl-E, Escape-B, Escape-F and so on work in > psql. I don't believe I did anything special to configure that. Check your > local readline documentation. Tom, I run psql from a urxvt virtual console, not emacs (which is where I write scripts.) > As Adrian notes, there's also \e, which is good for entering > or editing multi-line queries. Often when updating table rows I'll modify one string and the row ID so I'll learn to use \e to move around the string. Many thanks, Rich