Re: BUG #14287: psql_history gets wiped out

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rick Otten <rotten(at)windfish(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14287: psql_history gets wiped out
Date: 2016-08-12 15:30:52
Message-ID: 29361.1471015852@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Rick Otten <rotten(at)windfish(dot)net> 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Verite 2016-08-12 16:21:13 Re: BUG #14287: psql_history gets wiped out
Previous Message Rick Otten 2016-08-12 15:13:58 Re: BUG #14287: psql_history gets wiped out