Disabling the Pager in psql for the postgres User
Great! It looks like you successfully created the .psqlrc file in the postgres user's home directory (/var/lib/postgresql/) and confirmed that the pager is now disabled when running psql as the postgres user. The message "Pager usage is off" confirms that the configuration is working as expected.
Summary of What You Did
Switched to the
postgresuser:sudo -i -u postgresCreated the
.psqlrcfile in thepostgresuser's home directory and added the line:\pset pager offVerified the configuration by running
psqland confirming that the pager is disabled.
This is a good solution for ensuring that psql doesn't use a pager when run by the postgres user, which can be helpful for scripting or automated tasks where interactive paging is undesirable.
Written by A.M. Rinas