I'm running the following version of psql

psql (12.11)

on Windows Powershell running on Windows 10. Within the same shell session, when I log in and out of psql, it doesn't retain the previous commands (e.g. SELECT statements) that I ran in a previous session. What do I need to do in order for psql to retain its history, even if only during the same Windows PowerShell session?

  • I think this is simply not supported on Windows.
    – user1822
    Aug 18, 2022 at 5:06
  • I guess you could try building your own, using the Windows port of the readline library.
    – mustaccio
    Aug 20, 2022 at 17:24
  • Check to see if an 'up arrow' will retrieve last line requested in Windows Powershell, please and let us know. Aug 25, 2022 at 5:17


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.