bogus psql "could not save history file[...]" message in 9.3.6 - Mailing list pgsql-bugs

From David G. Johnston
Subject bogus psql "could not save history file[...]" message in 9.3.6
Date
Msg-id CAKFQuwZx4E53BHBUFseoawEtwyrmDhY5ksvzhYtkHEoNd3kc1Q@mail.gmail.com
Whole thread Raw
Responses Re: bogus psql "could not save history file[...]" message in 9.3.6  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: bogus psql "could not save history file[...]" message in 9.3.6  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Installed 9.3.6 from apt.postgresql.org onto a reasonably clean Ubuntu
14.04 (trusty)

$ sudo apt-get install [...] # ok
$ ls -la /var/lib/postgresql # 9.3 is the only result; equivalent to (ls
-la ~)
$ sudo su - postgres # ok
$ psql # ok
> select 1; # ok
> \q # 'could not save history to file "/var/lib/postgresql/.psql_history":
No such file or directory' !!!
$ ls -la /var/lib/postgresql # 9.3 and .psql_history are both present
$ cat /var/lib/postgresql/.psql_history # select 1; <newline> \q <eof>
$ psql # ok
> select 2; # ok
> \q # ok this time; no message
$ cat [...] # confirmed everything present
$ rm /var/lib/postgresql/.psql_history # gone
$ psql
> select 3;
> \q # same error again !!!
$ [confirm select 3 is present in .psql_history]

Seems like a file existence check and warning is in the wrong
place...everything works correctly except there is a bogus warning.

Or change the message to simply be "creating new .psql_history file in
/var/lib/postgresql"

Obviously its odd that /var/lib is where the history file is being placed
but the package sets that as HOME for the newly created postgres user...I'm
doubting this problem is limited to just that situation though.

David J.

pgsql-bugs by date:

Previous
From: jaime soler
Date:
Subject: Re: BUG #12851: Failed to initial Jackrabbit JCR Repository
Next
From: Tom Lane
Date:
Subject: Re: bogus psql "could not save history file[...]" message in 9.3.6