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...
postgres=# \d+Listofrelations Schema|Name|Type|Owner|Persistence|Accessmethod|Size|Description---+---+---+---+---+---+---+---public|example_tbl|table|postgres|permanent|heap|8192bytes|public|pg_stat_statements|view|postgres|permanent||0bytes|public|pg_stat_statements_info|view|postgres|p...
Tolist tables in a PostgreSQL database, you can use the\dcommand to get the basic information or the\dt+command for the detailed information about the tables (if you add + to commands, you will get additional information in the output): To describe any specific table, execute\d tablename...
\ef[FUNCNAME[LINE]]editfunctiondefinition with external editor...Informational(options:S=show system objects,+=additional detail)\d[S+]list tables,views,and sequences \d[S+]NAME describe table,view,sequence,or index \da[S][PATTERN]list aggregates ...
In Postgres, different meta-commands are used to describe database objects using psql. For instance, use the “\d”, “\dt”, “\dv”, “\ds”, and “\df” commands to describe relations, tables, views, sequences, and functions, respectively. All these meta-commands can be executed wi...
pg_ctl register -N ‘postgresq-xx’ $PGDATA 注册服务,服务名为postgresql-xx Pg_ctl reload -D $PGDATA 重新加载配置、 1.2psql 语法 psql是PostgreSQL 的交互式客户端工具。 使用方法: psql [选项]... [数据库名称 [用户名称]] 通用选项:
\det[+] [PATTERN] list foreign tables \des[+] [PATTERN] list foreign servers \deu[+] [PATTERN] list user mappings \dew[+] [PATTERN] list foreign-data wrappers \df[anptw][S+] [PATRN] list [only agg/normal/procedures/trigger/window] functions ...
SELECT tablename FROM pg_tables;WHERE tablename NOT LIKE 'pg%'AND tablename NOT LIKE 'sql_%'ORDER BY tablename;列出数据库名 \l 或 SELECT datname FROM pg_database;切换数据库 \c 数据库名 1、通过命令⾏查询 \d 数据库 —— 得到所有表的名字 \d 表名 —— 得到表结构 2、通过SQL语句...
List of schemas Name | Owner ---+--- accounts | postgres public | pg_database_owner 07、显示用户定义的函数 PostgreSQL 是一个功能繁重的数据库。如果您来自其他数据库(如 SQL Server),这可能会感觉有点违反直觉,因为很多讨论和培训都在谈论使用函数的陷阱,尤其是在查询性能方面。也就是说,能够快速列出...