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 1nkZNr-00049A-4V for pgsql-general@arkaria.postgresql.org; Fri, 29 Apr 2022 22:46:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nkZMq-0005Uk-6I for pgsql-general@arkaria.postgresql.org; Fri, 29 Apr 2022 22:45:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nkZMo-0005Ub-F3 for pgsql-general@lists.postgresql.org; Fri, 29 Apr 2022 22:45:39 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nkZMj-0000uB-Ln for pgsql-general@lists.postgresql.org; Fri, 29 Apr 2022 22:45:38 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id C019D320093A; Fri, 29 Apr 2022 18:45:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 29 Apr 2022 18:45:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1651272328; x= 1651358728; bh=uyLl06FwATYN1LNbkj2LkRgvtA6GymDAacRgyz82a/E=; b=V bIhsluOP5PnzXzalTgjpQ728Yray9z2aUAyNLyaE7KoCo68rO0BoomCHhJm4aAZ8 PFeCUnsL5s9inas0VnjBAdHhX+XSlFaqvB0wzF0pKmHD17hjWsugTgK6YGw/sjwz n1Ji3M8VGBSlJOu/bvq6xb+yopFjigckGxqI75SOamFA0f0YM1CXgLnjmi7lHrKO glgmnkBMX3Ka/+PAIKQCN2EKn2J/5EjJ9MZ1tf5Q+TVjZrCIWkRed+jL5wlHCfym jobjxq5bP1ggC5hjOQThiT/k+8m1KFZcDx8ctZ83dHbfu+9IKSmsuNorOfLO1Yff n4JA16gKOEk33Fi67dsXw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1651272328; x=1651358728; bh=uyLl06FwATYN1LNbkj2LkRgvtA6G ymDAacRgyz82a/E=; b=KmwDfeD9CnPXLtnIM9xAEyGNATMb9ScCWVLzEDJv/3FK Ct+ENnuV7mDM0IhC534sd92KBxI4AreEe7fxoqNjH8P/t65NTvygfOUTcz8OG0ms r9DiN+Fbnwc8a0q3AVU19XD+p4UB89zLb2Qw2smZLr7joMDq2B9YGLWcLXAxzZdr WU/Z1nI+lUI9uWRXlAB09AoJlORxJKouXPHg+bU9nLZU0d36ivRT4y7txnWjHPIg G47H/h7fifmrxy2gmJTU27Llt9bef1Ut1PDNt0YZwK1bPVq1/P+mQiB58R3VKPq0 oHZNpzNq5ZxbUjBgWpeqHhi6Auht4ccnttHyxmTTTw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddtgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenog fuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefuvfhfhffkffgfgggjtgfg sehtjeertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirg hnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnheptefh ffeukeehfeejkeehteeijeeiteeugeevfffhfeeujeekieduveffvdekueeknecuffhomh grihhnpeifohhrughprhgvshhsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrh drtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 29 Apr 2022 18:45:27 -0400 (EDT) Subject: Re: External psql editor To: Mladen Gogala , pgsql-general@lists.postgresql.org References: <7fef2d5f-6698-0bb5-11fe-ffd042a24ab1@wi3ck.info> <89e71248-2fa8-c6ee-9546-93286947ed3b@appl-ecosys.com> <8d23a17b-ba8d-1e69-7fc5-b551f9df5252@gmail.com> From: Adrian Klaver Message-ID: Date: Fri, 29 Apr 2022 15:45:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <8d23a17b-ba8d-1e69-7fc5-b551f9df5252@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/29/22 12:50 PM, Mladen Gogala wrote: > On 4/29/22 13:35, Jan Wieck wrote: >> Not that I know of. \e starts the external editor and you have to save >> and exit that editor to get back to psql in order to execute it. IMHO >> the whole construct has very limited usability. >> >> >> Regards, Jan > > Is there a way to define the name of the temporary file created by \e > command? I'd like to name it "afiedt.buf", not for sentimental reasons. > I already have a cron job that cleans afiedt.buf from my home directory > every hour and having psql name temporary file like that would simplify > the cleaning process. The name comes from another database with the same > editor construct as \e. I am actually quite used to that. If want to do something like that you would need to do(using VIM here): \e select 1; :w afiedt.buf or :wq afiedt.buf Assuming you closed the editor you could pick up the file later by doing. \e afiedt.buf > > Regards > > -- > Mladen Gogala > Database Consultant > Tel: (347) 321-1217 > https://dbwhisperer.wordpress.com > -- Adrian Klaver adrian.klaver@aklaver.com