"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
>> \q # 'could not save history to file "/var/lib/postgresql/.psql_history":
> No such file or directory' !!!
BTW, I poked around in the libedit sources and noted that it will call
wctomb() during write_history(), assuming it's configured to support wide
characters. Working hypothesis is that wctomb() is trying to read some
locale configuration file and not finding it, which it's probably okay
with, but our is-errno-set check is unhappy later. This behavior might
well vary depending on what locale environment you have set.
strace'ing psql while it exits might be informative.
regards, tom lane