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

Lists: pgsql-committers
From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Write psql's ~/.psql_history file using history_truncate_file()
Date: 2009-09-13 22:18:22
Message-ID: [email protected]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Log Message:
-----------
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 Wjtowicz.

Modified Files:
--------------
pgsql:
configure (r1.655 -> r1.656)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/configure?r1=1.655&r2=1.656)
configure.in (r1.610 -> r1.611)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/configure.in?r1=1.610&r2=1.611)
pgsql/src/bin/psql:
command.c (r1.206 -> r1.207)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/command.c?r1=1.206&r2=1.207)
input.c (r1.66 -> r1.67)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/input.c?r1=1.66&r2=1.67)
input.h (r1.32 -> r1.33)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/input.h?r1=1.32&r2=1.33)
pgsql/src/include:
pg_config.h.in (r1.141 -> r1.142)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/pg_config.h.in?r1=1.141&r2=1.142)
pg_config.h.win32 (r1.63 -> r1.64)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/pg_config.h.win32?r1=1.63&r2=1.64)