test-# \lList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges---+---+---+---+---+---pg1 | pg1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 |postgres | pg1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 |template0 | pg1 | UTF8 | en_US.UTF-8 | ...
postgres=# \l+ List of databases Name | Owner | Encoding | Collate | Ctype | ICU Locale | Locale Provider | Access privileges---+---+---+---+---+---+---+---advent_of_code
\df[antw][S+] [PATRN] list [only agg/normal/trigger/window] functions \dF[+] [PATTERN] list text search configurations \dFd[+] [PATTERN] list text search dictionaries \dFp[+] [PATTERN] list text search parsers \dFt[+] [PATTERN] list text search templates \dg[+] [PATTERN] list rol...
\dew[+] [PATTERN] list foreign-data wrappers \df[antw][S+] [PATRN] list [only agg/normal/trigger/window] functions \dF[+] [PATTERN] list text search configurations \dFd[+] [PATTERN] list text search dictionaries \dFp[+] [PATTERN] list text search parsers \dFt[+] [PATTERN] list te...
Note:To create aPostgreSQLdatabase, we will execute the“CREATE DATABASE”command from the psql(SQL Shell). You can execute the same command from pgAdmin's query tool to create a database. How to List the Databases? Open thepsql(SQL Shell) and execute the“\l”command to see the list...
postgres=# \l+List of databasesName | Owner | Encoding | Collate | Ctype | Access privileges | Size | Tablespace | Description---+---+---+---+---+---+---+---+---postgres | pg1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | 7993 kB | pg_default | default administrative ...
| | \dx[+] [pattern] | List extensions. | | \e [file] | Edit the query with external editor. | | \h | Show SQL syntax and help. | | \i filename | Execute commands from file. | | \l[+] [pattern] | List databases. | | \n[+] [name] [param1 param2 ...] | List ...
You are using psql,the command-lineinterfacetoPostgreSQL.Type:\copyrightfordistribution terms \hforhelpwithSQLcommands \?forhelpwithpsql commands \g or terminatewithsemicolon to execute query \q to quit psql工具元命令可以帮助我们更有效的利用数据库,下面是一些常用的元命令。
command invoke\--resource-groupmigrate-postgresql\--namepostgresqlvm \--command-idRunShellScript \--scripts" # Install PostgreSQL sudo echo deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main > /etc/apt/sources.list.d/pgdg.list sudo wget --quiet -O -...
\? options show help on psql command-line options \? variables show help on special variables \h [NAME] help on syntax of SQL commands, * for all commands Query Buffer ... Input/Output ... Conditional ... Informational ... Formatting ...