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 1tiIl6-00EAll-VO for pgsql-general@arkaria.postgresql.org; Wed, 12 Feb 2025 19:50:56 +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 1tiIl4-00DEhp-V3 for pgsql-general@arkaria.postgresql.org; Wed, 12 Feb 2025 19:50:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tiIl4-00DEhg-KR for pgsql-general@lists.postgresql.org; Wed, 12 Feb 2025 19:50:55 +0000 Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tiIl2-000UR4-36 for pgsql-general@postgresql.org; Wed, 12 Feb 2025 19:50:54 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 1391B11401A6; Wed, 12 Feb 2025 14:50:51 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 12 Feb 2025 14:50:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1739389850; x=1739476250; bh=pRY02LpwPqbjoTEEWJhtxwV0/CIgOzZDnfGMUvgNFYs=; b= nwGfcRbdvf/rb22ta8naEmrYS8x9dFV5z7ND7KbAQv7u8IQkwmogNrBwg4mcI+sY jiO6pZohseGlrf238OZHqIBkDLTG35pJ7tY2qkUeTvALWJMD86Tk6X1tzFzK2pRe UsDcC4IMj3oooKMJG8z9vKRQH2nxP9O+oZPZi9vyHeGybB81M6SiKCeSZtkSoyp0 RR/ry9Bj55xwZtIgDhklVVnuDGyCCfawRM+1q8KdKP/gTuY5O8zn/5B/0V7qz1d3 WqtsJBo75CHM3MizqMfYlmCuySpKFEdQeVivtTmps0FrtwDFkSg3TOeErWkigv7H 8r3icqhUQszwseeehayMGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1739389850; x=1739476250; bh=p RY02LpwPqbjoTEEWJhtxwV0/CIgOzZDnfGMUvgNFYs=; b=z4IXeflWo6E6kD6fQ w7jMzu/gMrg+hkuKXuMFgCAg5IBOp+2WPhYDRF3UCvL0dfgJA5wlPYJLF8yBGXxI I7Lwn79+tkjTNMmpA5zpp8HfcdxZrZWkCRnnvPx8CNsk9V+uixMhFa5AEVka9uuX MyJJLdkqF0oUTwS9v7a8FrWkLz8Kr+HA9mccGF4667Y9A2itNmiE/FTWLs+vLKCU dsArWRk5MtC7BRf+/N41As352M6cSSWP3SLNPVnzknPfe2fVOa8owjLoOx1JIVOp q7OhEUsfxSxvgr6RCm0WM+NqqfXfdj/7CbAAMH4qYdAq69vi2UwhoqBj4L6yrBby h1Rgw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeggeejiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrh esrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepiedvhfeiheehgeeuieel jeeitedtjeehudegfeelkedvleekhedtgfeiffefkedunecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghk lhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtoheprhhshhgvphgrrhgusegrphhplhdqvggtohhshihsrdgtohhmpdhrtghp thhtohepphhgshhqlhdqghgvnhgvrhgrlhesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Feb 2025 14:50:50 -0500 (EST) Message-ID: <5b2fd208-88d8-4903-a359-884bd838a8f3@aklaver.com> Date: Wed, 12 Feb 2025 11:50:49 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: psql command line editing To: Rich Shepard , pgsql-general References: <61255ab-6249-1226-7db6-4ecc3e4c127b@appl-ecosys.com> <3370941.1739388555@sss.pgh.pa.us> <40bef2b1-62a1-ed-63c0-6487bbcdd133@appl-ecosys.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <40bef2b1-62a1-ed-63c0-6487bbcdd133@appl-ecosys.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/12/25 11:44, Rich Shepard wrote: > 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.) The point Tom was making is that psql uses readline for it's editing positioning and that for him Emacs movement commands work in psql. > >> 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 > > -- Adrian Klaver adrian.klaver@aklaver.com