Difference between revisions of "Psql"

From wikieduonline
Jump to navigation Jump to search
Line 43: Line 43:
 
* <code>[[pg_hba.conf]]</code> (PostgreSQL Client Authentication Configuration File)
 
* <code>[[pg_hba.conf]]</code> (PostgreSQL Client Authentication Configuration File)
 
* <code>[[apt install postgresql]]</code>
 
* <code>[[apt install postgresql]]</code>
 +
* <code>[[.psql]]</code>
 
* {{TOC operation databases}}
 
* {{TOC operation databases}}
  

Revision as of 16:09, 16 August 2021

wikipedia:psql

  • Ubuntu installation: apt install postgresql-client-12
sudo -u postgres psql
psql (10.12 (Ubuntu 10.12-0ubuntu0.18.04.1))
Type "help" for help.
postgres=#


psql --host=mypostgresql.c6c8mwvfdgv0.us-west-2.rds.amazonaws.com --port=5432 --username=awsuser --password --dbname=mypgdb 
psql -h localhost -U YOUR_USERNAME DB_NAME
psql -h <REMOTE HOST> -p <REMOTE PORT> -U <DB_USER> <DB_NAME>


psql
psql: FATAL:  role "root" does not exist


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
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


FATAL: no pg_hba.conf entry for host "1x.1xx.2xx.1xx", user "your_username", database "your_db_name", SSL off

Options

  • Port (-p): psql -p 5432

Related terms

See also

Advertising: