List all tables in database along with some additional information # \d+ List of relations Schema | Name | Type | Owner | Size | Description ---+---+---+---+---+--- public | users | table | jarvis | 401 MB | (1 row) Describe a table with additional information #\d+ users...
postgres=# \df List of functionsSchema | Name | Result data type | Argument data types | Type---+---+---+---
\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 \dE[S+] [PATTERN] list foreign tables \dx[+] [PATTERN] li...
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...
在10g有两种:range-hash,range-list 注意顺序,根分区只能是range分区,子分区可以是hash,或者list。 如下,创建组合分区: create table test1_1( ) ——注意没有分号。 partition by range(transaction_date) subpartition by hash(transaction_id) ——注意语法格式。
\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 ...
\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 ...
[pg@pg data]$ psql --help psql is the PostgreSQL interactive terminal. Usage: psql [OPTION]... [DBNAME [USERNAME]] General options: -c, --command=COMMAND run only single command (SQL or internal) and exit -d, --dbname=DBNAME database name to connect to (default: "pg") ...