LightDB Enterprise Postgres常用数据字典入门一览

技术杂谈74

查看当前数据库

postgres=# select current_database();
 current_database
-+-------+-------------------+-------------------+-------------------+-------------
 gpadmin             | t        | t          | t             | t           | t            | t           | t              |           -1 | ********    |               |           |        6055
 |    10 | t                 | t                 | t                 |        6438
 gpmon               | t        | t          | f             | t           | t            | t           | f              |           -1 | ********    |               |           |        6055
 | 16384 | f                 | f                 | f                 |        6438
 gpcc_basic          | f        | t          | f             | f           | f            | f           | f              |           -1 | ********    |               |           |        6055
 | 16893 | f                 | f                 | f                 |        6437
 gpcc_operator       | f        | t          | f             | f           | f            | f           | f              |           -1 | ********    |               |           |        6055
 | 16894 | f                 | f                 | f                 |        6437
 gpcc_operator_basic | f        | t          | f             | f           | f            | f           | f              |           -1 | ********    |               |           |        6055
 | 16895 | f                 | f                 | f                 |        6437
(5 rows)
postgres=# select * from pg_user;
 usename | usesysid | usecreatedb | usesuper | usecatupd | userepl |  passwd  | valuntil | useconfig
 pg_authid                | t
 pg_statistic             | t
 pg_user_mapping          | t
 pg_type                  | t

```
mydb=# select tablename,has_table_privilege(tablename,'select') select_priv,has_table_privilege(tablename,'INSERT') insert_priv,has_table_privilege(tablename,'UPDATE') update_priv from pg_tables where tablename like 'pg_%';
tablename | select_priv | insert_priv | update_priv

Original: https://www.cnblogs.com/zhjh256/p/15954458.html
Author: zhjh256
Title: LightDB Enterprise Postgres常用数据字典入门一览