Rick Otten <rotten(at)windfish(dot)net> writes:
> I'm using the repo:
> deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main 9.5
> That repo version is using _libedit_, not _libreadline_:
Hmm. Our general experience is that libedit is buggier than libreadline,
but I've not heard of this particular symptom before. It might be
entertaining to see if you can strace psql while it's doing this.
Something like
strace -o some.file psql ... usual parameters ...
... issue a command or two just to be sure there's history to write
... close window
and then look at the last few dozen lines of some.file.
regards, tom lane