Reputation: 1544
When login to the database using psql -u postgres
, all the commands entered there can be seen in and recalled from history.
I created a role with a password and I would like to clear that entry.
How can I clear the history?
Upvotes: 5
Views: 12936
Reputation: 71
If you used sudo -u postgres
, the file should be in the home of your postgres
user. In my case it is /var/lib/postgresql/.psql_history
.
Edit: I misread your original command and thought sudo was used.
Upvotes: 7
Reputation: 189
Please check on the /home/user/.psql_history
, then open the file if we want we can clear all the commands or the necessary commands and save the file.
Upvotes: 14