Difference between revisions of "Psql"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
[[wikipedia:psql]]
 
[[wikipedia:psql]]
 +
 +
* Installation: <code>apt install postgresql-client-12</code>
 +
  
 
  psql
 
  psql

Revision as of 10:53, 9 August 2021

wikipedia:psql

  • Installation: apt install postgresql-client-12


psql
psql: FATAL:  role "root" does not exist
sudo -u postgres psql
psql (10.12 (Ubuntu 10.12-0ubuntu0.18.04.1))
Type "help" for help.
postgres=#
su - posgres && psql
psql (10.12 (Ubuntu 10.12-0ubuntu0.18.04.1))
Type "help" for help.
postgres=#
sudo -u postgres psql
could not change directory to "/root": Permission denied
psql (12.6 (Ubuntu 12.6-0ubuntu0.20.04.1))
Type "help" for help.


psql -h localhost -U YOUR_USERNAME DB_NAME
psql -h <REMOTE HOST> -p <REMOTE PORT> -U <DB_USER> <DB_NAME>
psql
Warning: No existing cluster is suitable as a default target. Please see man pg_wrapper(1) how to specify one.
Error: You must install at least one postgresql-client-<version> package


Options

  • Port (-p): psql -p 5432

Related terms

See also

Advertising: