Search code examples
command-linepsql

How to clear PostgreSQL psql command history


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?


Solution

  • 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.