FS#39626 - [postgresql] /var/lib/postgres/.psql_history missing

Attached to Project: Arch Linux
Opened by Dan Milon (danmilon) - Wednesday, 26 March 2014, 08:24 GMT
Last edited by Dan McGee (toofishes) - Wednesday, 26 March 2014, 20:16 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When psql terminates it tries to write the command history to /var/lib/postgres/.psql_history. The file does not exist and it does not have sufficient permissions to create it.


Steps to reproduce:

pacman -S postgres
initdb --locale en_US.UTF-8 -E UTF8 -D '/var/lib/postgres/data'
systemctl start postgresql
sudo -u postgres psql
[..write some sql and exit..]
error occurs now.

Possible fixes:

* add empty .psql_history file in the package with proper permissions.
* set owner of /var/lib/postgres to user postgres.
This task depends upon

Closed by  Dan McGee (toofishes)
Wednesday, 26 March 2014, 20:16 GMT
Reason for closing:  Won't fix
Additional comments about closing:  Recommend running as not the postgresql user for psql.
Comment by Dan McGee (toofishes) - Wednesday, 26 March 2014, 15:41 GMT
Why are you running as the postgres user and not any other user on your box that has been granted permissions to the DB? Normally people don't run interactive psql processes under this user, so it has never been a problem. I'd be very reluctant to fix this.
Comment by Dan Milon (danmilon) - Wednesday, 26 March 2014, 15:44 GMT
I see what you mean. That makes sense, I don't *need* to run it under the postgres user. Feel free to close the issue, and thanks for the quick reply!

Loading...