上一章节我们讲了如何创建数据库,接下来我们来讨论如何去选择我们创建的数据库。数据库的命令窗口PostgreSQL 命令窗口中,我们可以命令提示符后面输入 SQL 语句:postgres=#使用 \l 用于查看已经存在的数据库:postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ---+...
Command-line: Runlorlistinside thepsqlshell. SQL query: ExecuteSELECT datname FROM pg_database;. GUI tools: Use database clients like DbVisualizer or pgAdmin to view databases visually. psql command: Runpsql -lin a terminal. How to deal with “The term 'psql' is not recognized” error on...
template1 | postgres | UTF8 | Chinese (Simplified)_China.936 | Chinese (Simplified)_China.936 | =c/postgres +| 7441 kB | pg_default | default template for new databases | | | | | postgres=CTc/postgres | | | (3 行记录) 列出表、视图、序列: 选项说明:S = 显示系统对象, + = 其余...
Command-line: Runlorlistinside thepsqlshell. SQL query: ExecuteSELECT datname FROM pg_database;. GUI tools: Use database clients like DbVisualizer or pgAdmin to view databases visually. psql command: Runpsql -lin a terminal. How to deal with “The term 'psql' is not recognized” error on...
To get the list of PostgreSQL Databases, open psql shell and run the list command as shown below. </> Copy \l In the following PostgreSQL shell, when we run the list databases command, the output is a table with the name of database, owner of database, database encoding, and other ...
查看数据库: \加上字母l,相当于mysql的,mysql> show databases; # \lListofdatabasesName|Owner|Encoding|Collate|Ctype|Access privileges---+---+---+---+---+---postgres|postgres|UTF8|en_US.UTF-8|en_US.UTF-8|template0|postgres|UTF8|en_US.UTF-8|en_US.UTF-8|=c/postgres|||postgres=...
postgres=# \l+ List of databases Name | Owner | Encoding | Collate | Ctype | ICU Locale | Locale Provider | Access privileges---+---+---+---+---+---+---+---advent_of_code
postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ---+---+---+---+---+--- postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 | template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres + | | | | | postgres=CTc/...
[root@EULER1~]# su-pg1-c"psql -Upostgres -p 5432 -h 192.168.123.60"Passwordforuser postgres:psql(12.5)Type"help"forhelp.postgres=# create tablespace mytbs location'/opt/custome-tablespace';CREATETABLESPACEpostgres=# \db+Listoftablespaces ...
\des[+] [PATTERN] list foreign servers \deu[+] [PATTERN] list user mappings \dew[+] [PATTERN] list foreign-data wrappers \df[antw][S+] [PATRN] list [only agg/normal/trigger/window] functions \dF[+] [PATTERN] list text search configurations ...