psql_history 的限制

ayd*_*dow 5 postgresql-9.3 postgresql-9.5

我找不到(ctrl-rpsql和内使用less ~/.psql_history)我几个月前执行的特定查询。我最近也从 9.3 升级到 9.5,所以我不确定psql_history升级时是否有限制或是否被删除。

大小是否有限制psql_history,如果有,我该如何增加它?

提前致谢!!

Phi*_*lᵀᴹ 5

有一个psql变量可以设置要保存在历史记录中的命令数量:

postgres=# \set HISTSIZE 100
postgres=# \echo :HISTSIZE
100
postgres=#
Run Code Online (Sandbox Code Playgroud)

文档中:

HISTSIZE - 要存储在命令历史记录中的命令数。默认值为 500

您可以将其设置在您的~/.psqlrc.