Re: BUG #14287: psql_history gets wiped out - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #14287: psql_history gets wiped out
Date
Msg-id 29361.1471015852@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #14287: psql_history gets wiped out  (Rick Otten <rotten@windfish.net>)
List pgsql-bugs
Rick Otten <rotten@windfish.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



pgsql-bugs by date:

Previous
From: Rick Otten
Date:
Subject: Re: BUG #14287: psql_history gets wiped out
Next
From: "Daniel Verite"
Date:
Subject: Re: BUG #14287: psql_history gets wiped out