Fix psql history file