Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYEQr-0007A5-2Z for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Aug 2016 15:31:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bYEQq-0000Fa-Lc for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Aug 2016 15:31:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bYEQC-0007Et-63 for pgsql-bugs@postgresql.org; Fri, 12 Aug 2016 15:30:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bYEQ9-0004FJ-MS for pgsql-bugs@postgresql.org; Fri, 12 Aug 2016 15:30:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u7CFUqJe029362; Fri, 12 Aug 2016 11:30:52 -0400 From: Tom Lane To: Rick Otten cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14287: =?UTF-8?Q?psql=5Fhistory=20gets=20wiped=20?= =?UTF-8?Q?out?= In-reply-to: <96ddfae45fe23b4eb77564c0a04f2eeb@www.windfish.net> References: <20160811183456.GA656368@alvherre.pgsql> <15159.1470941747@sss.pgh.pa.us> <24679.1470950130@sss.pgh.pa.us> <27413.1471013401@sss.pgh.pa.us> <96ddfae45fe23b4eb77564c0a04f2eeb@www.windfish.net> Comments: In-reply-to Rick Otten message dated "Fri, 12 Aug 2016 11:13:58 -0400" Date: Fri, 12 Aug 2016 11:30:52 -0400 Message-ID: <29361.1471015852@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Rick Otten writes: > Wouldn't it be better to write the commands to the history file as you > go instead of at the end of the session? No, I wouldn't think so. That just means you have windows for failure all the time rather than only at session end. Keep in mind that the write is seldom just an append, since the history length is supposed to be bounded. > At most you would only need to close the file pointer when you tear down > instead of having to flush the command history (which may be hundreds of > queries). The APIs that libreadline and libedit provide for this do not look anything like what you're assuming here. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs