Write psql's ~/.psql_history file using history_truncate_file() and

Tom Lane <tgl@sss.pgh.pa.us>

Commit: e97281c46cb14ecb91c473b6bd2b0435a50c0875
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-09-13T22:18:22Z
Releases: 9.0.0
Write psql's ~/.psql_history file using history_truncate_file() and
append_history(), if libreadline is new enough to have those functions
(they seem to be present at least since 4.2; but libedit may not have them).
This gives significantly saner behavior when two or more sessions overlap in
their use of the history file; although having two sessions exit at just the
same time is still perilous to your history.  The behavior of \s remains
unchanged, ie, overwrite whatever was there.
Per bug #5052 from Marek Wójtowicz.

Files

PathChange+/−
configure modified +2 −1
configure.in modified +2 −2
src/bin/psql/command.c modified +2 −2
src/bin/psql/input.c modified +74 −18
src/bin/psql/input.h modified +2 −2
src/include/pg_config.h.in modified +6 −3
src/include/pg_config.h.win32 modified +0 −3