attbyval | boolean | | not null | | plain | |
attstorage | "char" | | not null | | plain | |
attalign | "char" | | not null | | plain | |
attnotnull | boolean | | not null | | plain | |
atthasdef | boolean | | not null | | plain | |
attidentity | "char" | | not null | | plain | |
attisdropped | boolean | | not null | | plain | |
attislocal | boolean | | not null | | plain | |
attinhcount | integer | | not null | | plain | |
attcollation | oid | | not null | | plain | |
attacl | aclitem[] | | | | extended | |
attoptions | text[] | | | | extended | |
attfdwoptions | text[] | | | | extended | |
索引:
"pg_attribute_relid_attnam_index" UNIQUE, btree (attrelid, attname)
"pg_attribute_relid_attnum_index" UNIQUE, btree (attrelid, attnum)
postgres=#
查看PostgreSQL数据库连接及数量
postgres=# select * from pg_stat_activity;
这个表的信息很多,可以只 查询其中部分字段:
postgres=# select datid,datname,pid,usename,state,client_addr,query from pg_stat_activity;
datid | datname | pid | usename | state | client_addr | query
-------+----------+-------+----------+--------+-------------+---------------------------------------------------------------------------------
| | 18904 | | | |
| | 18556 | postgres | | |