pg_db_role_setting

一个系统表,存储为运行时配置变量设置的角色默认值

pg_db_role_setting 是一个存储运行时配置变量默认值的系统目录表,适用于每个用户/角色和数据库。

pg_db_role_settingPostgreSQL 9.0 中添加。

此表在集群中的所有数据库之间共享。

psql

\drds 列出此表存储的每个数据库的角色设置。

按 PostgreSQL 版本定义

pg_db_role_setting (PostgreSQL 17)

         Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Collation | Nullable | Default 
-------------+--------+-----------+----------+---------
 setdatabase | oid    |           | not null | 
 setrole     | oid    |           | not null | 
 setconfig   | text[] | C         |          | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" PRIMARY KEY, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 16)

         Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Collation | Nullable | Default 
-------------+--------+-----------+----------+---------
 setdatabase | oid    |           | not null | 
 setrole     | oid    |           | not null | 
 setconfig   | text[] | C         |          | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" PRIMARY KEY, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 15)

         Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Collation | Nullable | Default 
-------------+--------+-----------+----------+---------
 setdatabase | oid    |           | not null | 
 setrole     | oid    |           | not null | 
 setconfig   | text[] | C         |          | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" PRIMARY KEY, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 14)

         Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Collation | Nullable | Default 
-------------+--------+-----------+----------+---------
 setdatabase | oid    |           | not null | 
 setrole     | oid    |           | not null | 
 setconfig   | text[] | C         |          | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" PRIMARY KEY, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 13)

         Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Collation | Nullable | Default 
-------------+--------+-----------+----------+---------
 setdatabase | oid    |           | not null | 
 setrole     | oid    |           | not null | 
 setconfig   | text[] | C         |          | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 12)

         Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Collation | Nullable | Default 
-------------+--------+-----------+----------+---------
 setdatabase | oid    |           | not null | 
 setrole     | oid    |           | not null | 
 setconfig   | text[] | C         |          | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 11)

         Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Collation | Nullable | Default 
-------------+--------+-----------+----------+---------
 setdatabase | oid    |           | not null | 
 setrole     | oid    |           | not null | 
 setconfig   | text[] |           |          | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 10)

         Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Collation | Nullable | Default 
-------------+--------+-----------+----------+---------
 setdatabase | oid    |           | not null | 
 setrole     | oid    |           | not null | 
 setconfig   | text[] |           |          | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 9.6)

Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Modifiers 
-------------+--------+-----------
 setdatabase | oid    | not null
 setrole     | oid    | not null
 setconfig   | text[] | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 9.5)

Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Modifiers 
-------------+--------+-----------
 setdatabase | oid    | not null
 setrole     | oid    | not null
 setconfig   | text[] | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 9.4)

Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Modifiers 
-------------+--------+-----------
 setdatabase | oid    | not null
 setrole     | oid    | not null
 setconfig   | text[] | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 9.3)

Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Modifiers 
-------------+--------+-----------
 setdatabase | oid    | not null
 setrole     | oid    | not null
 setconfig   | text[] | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 9.2)

Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Modifiers 
-------------+--------+-----------
 setdatabase | oid    | not null
 setrole     | oid    | not null
 setconfig   | text[] | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 9.1)

Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Modifiers 
-------------+--------+-----------
 setdatabase | oid    | not null
 setrole     | oid    | not null
 setconfig   | text[] | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

pg_db_role_setting (PostgreSQL 9.0)

Table "pg_catalog.pg_db_role_setting"
   Column    |  Type  | Modifiers 
-------------+--------+-----------
 setdatabase | oid    | not null
 setrole     | oid    | not null
 setconfig   | text[] | 
Indexes:
    "pg_db_role_setting_databaseid_rol_index" UNIQUE, btree (setdatabase, setrole), tablespace "pg_global"
Tablespace: "pg_global"
    

文档: pg_db_role_setting

更改历史记录

示例

postgres=# SELECT * FROM pg_db_role_setting ;
 setdatabase | setrole |                 setconfig
-------------+---------+-------------------------------------------
           0 |   16384 | {"search_path=app, hstore, public"}
           0 |   16385 | {"search_path=admin, users, public"}
(2 rows)

内容也可以使用 psql 命令 \drds 显示。

postgres=# \drds
                     List of settings
   Role   | Database |              Settings
----------+----------+-------------------------------------
 app      |          | search_path=app, hstore, public
 admin    |          | search_path=admin, users, public

分类

集群范围表管理/管理系统目录

另请参阅

pg_authid

反馈

提交任何关于 "pg_db_role_setting" 的评论、建议或更正 此处