Turn off pager for psql’s interactive output

TL;DR: \pset pager 0 From the \pset section of the psql manual: pager Controls use of a pager program for query and psql help output. If the environment variable PAGER is set, the output is piped to the specified program. Otherwise a platform-dependent default (such as more) is used. When the pager option is off, … Read more

psql: FATAL: database “” does not exist

It appears that your package manager failed to create the database named $user for you. The reason that works for you is that template1 is a database created by postgres itself, and is present on all installations. You are apparently able to log in to template1, so you must have some rights assigned to you … Read more

psql: command not found Mac

You have got the PATH slightly wrong. You need the PATH to “the containing directory”, not the actual executable itself. Your PATH should be set like this: without the extra sql part in it. Also, you must remove the spaces around the equals sign. Keywords: Postgresql, PATH, macOS, OSX, psql

Postgresql: Scripting psql execution with password

To answer your question, there are several ways provide a password for password-based authentication: Via the password prompt. Example: psql -h uta.biocommons.org -U foo Password for user foo: In a pgpass file. See libpq-pgpass. Format: <host>:<port>:<database>:<user>:<password> With the PGPASSWORD environment variable. See libpq-envars. Example: export PGPASSWORD=yourpass psql … # Or in one line for this … Read more