options show help on psql command-line options \? variables show help on special variables \h [NAME] help on syntax of SQL commands, * for all commandsQuery Buffer \e [FILE] [LINE] edit the query buffer (or file) with external editor \ef [FUNCNAME [LINE]] edit function...
\drds [PATRN1 [PATRN2]] list per-database role settings \dRp[+] [PATTERN] list replication publications \dRs[+] [PATTERN] list replication subscriptions \ds[S+] [PATTERN] list sequences \dt[S+] [PATTERN] list tables \dT[S+] [PATTERN] list data types \du[S+] [PATTERN] list roles...
\drds [ROLEPTRN [DBPTRN]] list per-database role settings \dRp[+] [PATTERN] list replication publications \dRs[+] [PATTERN] list replication subscriptions \ds[S+] [PATTERN] list sequences \dt[S+] [PATTERN] list tables \dT[S+] [PATTERN] list data types \du[S+] [PATTERN] list ro...
"select * from pg_tables" —— 得到当前db中所有表的信息(这里pg_tables是系统视图) "select tablename from pg_tables where schemaname='public'" —— 得到所有用户自定义表的名字(这里"tablename"字段是表的名字,"schemaname"是schema的名字。用户自定义的表,如果未经特殊处理,默认都是放在名为public的sc...
postgres=# \dn List of schemas Name | Owner ---+--- pgxc | tbase public | tbase (2 rows) \dn+显示当前库所有模式(包含注释) postgres=# \dn+ List of schemas Name | Owner | Access privileges | Description ---+---+---+--- pgxc | tbase | | public | tbase | tbase=UC/tbase +...
\d[S+] list tables, views, and sequences \d[S+] NAME describe table, view, sequence, or index \da[S] [PATTERN] list aggregates \dA[+] [PATTERN] list access methods … 二、基本元命令 01、连接到不同的数据库 该\c命令将连接到同一服务器上的新数据库。如果您使用-W选项连接到服务器,...
\?options show help on psql command-line options \?variables show help on special variables \h[NAME]help on syntax of SQL commands,*forall commands Query Buffer \e[FILE][LINE]edit the query buffer(or file)with external editor \ef[FUNCNAME[LINE]]editfunctiondefinition with external editor.....
在psql中,批量选择数据库对象需要使用多个SELECT语句,每个SELECT语句选择一个特定的对象类型(如表、视图、函数等)。可以使用UNION ALL将所有这些SELECT语句的结果集合并在一起。 在PostgreSQL 中,可以使用以下步骤来选择数据库并批量选择数据库对象: (图片来源网络,侵删) ...
\? 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 \e [FILE] [LINE] edit the query buffer (or file) with external editor ...
Also, including a + at the end of the command will return additional details, analogous to a an advanced output mode. For example, the two commands below both list the tables, views, and sequences of a database, but the second form provides additional details. 1 2 3 4 5 6 7 8...