List all tables in database along with some additional information # \d+ List of relations Schema | Name | Type | Owner | Size | Description -------+-------+-------+-----------+--------+------------- public | u
postgres=# \df List of functionsSchema | Name | Result data type | Argument data types | Type---+---+---+---
\dp [PATTERN] list table, view, and sequence access privileges \drds [PATRN1 [PATRN2]] list per-database role settings \ds[S+] [PATTERN] list sequences \dt[S+] [PATTERN] list tables \dT[S+] [PATTERN] list data types \du[+] [PATTERN] list roles \dv[S+] [PATTERN] list views...
list operators \dO[S+] [PATTERN] list collations \dp [PATTERN] list table, view, and sequence access privileges \dP[itn+] [PATTERN] list [only index/table] partitioned relations [n=nested] \drds [ROLEPTRN [DBPTRN]] list per-database role settings \dRp[+] [PATTERN] list replication ...
To list all databases hosted on the server, execute the following command: \l To connect to any particular database, use the below command: \c <database_name> Tolist tables in a PostgreSQL database, you can use the\dcommand to get the basic information or the\dt+command for the detail...
List of schemas Name | Owner ---+--- accounts | postgres public | pg_database_owner 07、显示用户定义的函数 PostgreSQL 是一个功能繁重的数据库。如果您来自其他数据库(如 SQL Server),这可能会感觉有点违反直觉,因为很多讨论和培训都在谈论使用函数的陷阱,尤其是在查询性能方面。也就是说,能够快速列出...
pg_ctl register -N ‘postgresq-xx’ $PGDATA 注册服务,服务名为postgresql-xx Pg_ctl reload -D $PGDATA 重新加载配置、 1.2psql 语法 psql是PostgreSQL 的交互式客户端工具。 使用方法: psql [选项]... [数据库名称 [用户名称]] 通用选项:
\o [FILE] send all query results to file or |pipe \qecho [STRING] write string to query output stream (see \o)Informational (options: S = show system objects, + = additional detail)\d[S+] list tables, views, and sequences ...
\des[+] [PATTERN] list foreign servers \det[+] [PATTERN] list foreign tables \deu[+] [PATTERN] list user mappings \dew[+] [PATTERN] list foreign-data wrappers \df[anptw][S+] [FUNCPTRN [TYPEPTRN ...]] list [only agg/normal/procedure/trigger/window] functions ...
\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...Informational(options:S=show system objects,+=additional detail)\d[S+]list tables,views,and...