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 1nkUBE-0006dJ-Lm for pgsql-general@arkaria.postgresql.org; Fri, 29 Apr 2022 17:13:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nkUBC-0003M7-2B for pgsql-general@arkaria.postgresql.org; Fri, 29 Apr 2022 17:13:18 +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 1nkUBB-0003FE-Hd for pgsql-general@lists.postgresql.org; Fri, 29 Apr 2022 17:13:17 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nkUB4-0001nE-IJ for pgsql-general@lists.postgresql.org; Fri, 29 Apr 2022 17:13:16 +0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 175622A0108 for ; Fri, 29 Apr 2022 10:13:09 -0700 (PDT) Date: Fri, 29 Apr 2022 10:13:09 -0700 (PDT) From: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Re: External psql editor In-Reply-To: <7fef2d5f-6698-0bb5-11fe-ffd042a24ab1@wi3ck.info> Message-ID: <89e71248-2fa8-c6ee-9546-93286947ed3b@appl-ecosys.com> References: <7fef2d5f-6698-0bb5-11fe-ffd042a24ab1@wi3ck.info> 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 Fri, 29 Apr 2022, Jan Wieck wrote: > What you are missing is that even though the PSQL_EDITOR env variable is > set, psql itself doesn't emulate that editor's behavior natively. You need > to actually launch the editor (possibly while having a partial query in > the buffer) with the \e command. Jan, Ah! That wasn't mentioned in the thread I read. > While in psql, type \e and Enter. You will have the current query buffer > in the editor. You can do this at the end of a partial (not yet semicolon > terminated) query. Can I set it before entering any command or better yet, when I invoke psql? Thanks very much, Rich