在psql中自定义传呼机

在psql中自定义传呼机

本文介绍了在psql中自定义传呼机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 当我以交互模式使用PostgreSQL的命令行工具 psql 时,它将列出数据作为分页输出。When I use psql, the command line tool of PostgreSQL, in interactive mode, it lists data as paginated output.但是,因为我在可以处理长输出的终端应用程序中使用了 psql ,所以我想得到整个输出而不用烦人的-more-行进行分页。However, because I use psql in a terminal application which can handle long outputs itself, I rather would like to get the whole output without the paginating with the annoying --more-- line.有什么方法可以自定义 psql 中的分页行为?我试图在周围的shell环境中将 LESS 设置为 cat ,但这无济于事。Is there any way to customise the paging behavior in psql? I tried to set LESS in the surrounding shell environment to cat, but this din't help.有什么建议吗?推荐答案来自精整 psql 手册:当 pager 选项关闭,不使用寻呼机程序。启用分页器选项后,将在适当的情况下使用分页器When the pager option is off, the pager program is not used. When the pager option is on, the pager is used when appropriate因此您可以从 psql中说出这一点提示:psql> \pset pager off关闭寻呼机。如果希望始终应用此功能,则可以在〜/ .psqlrc 文件中添加 pset pager off 。to turn the pager off. If you want this to always apply, you can add \pset pager off to your ~/.psqlrc file.您还可以使用 psql \? >提示以快速获取您可以使用的特殊命令的摘要。You can also use \? from the psql prompt to get a quick summary of the special commands at your disposal. 这篇关于在psql中自定义传呼机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-04 22:42