SYSTEM CATALOG系统目录表
pg_authid
授权标识符(角色)
系统目录表 引入 9.0(基线) 现存至 20 devel 3 次结构变更
版本轨迹
相对 PostgreSQL 17 无变化。
目录pg_authid包含关于数据库授权标识符(角色)的信息。角色涵盖了“用户”和“组”这两个概念。用户本质上只是设置了rolcanlogin标志的角色。任何角色(无论是否设置了rolcanlogin)都可以拥有其他角色作为成员;参见pg_auth_members。
由于这个目录包含密码,它不应公开可读。pg_roles是建立在pg_authid之上的公开可读视图,它会隐藏密码字段。
Chapter 21包含关于用户和权限管理的详细信息。
由于用户标识符是集簇范围的,pg_authid在一个集簇的所有数据库之间共享:在一个集簇中只有一份pg_authid拷贝,而不是每个数据库一份。
字段
PostgreSQL 18 的 12 个字段,按定义顺序排列。说明默认用本站手册的译文,没有译文的按英文原文显示。
| 字段 | 类型 | 说明 |
|---|---|---|
oid
|
oidNOT NULL
|
行标识符 |
rolname
|
nameNOT NULL
|
角色名 |
rolsuper
|
booleanNOT NULL
|
角色有超级用户权限 |
rolinherit
|
booleanNOT NULL
|
该角色是否会自动继承其所属其他角色的权限 |
rolcreaterole
|
booleanNOT NULL
|
角色能创建更多角色 |
rolcreatedb
|
booleanNOT NULL
|
角色能创建数据库 |
rolcanlogin
|
booleanNOT NULL
|
角色是否能登录。即该角色是否能够作为初始会话授权标识符 |
rolreplication
|
booleanNOT NULL
|
角色是一个复制角色。复制角色可以启动复制连接并且创建和删除复制槽。 |
rolbypassrls
|
booleanNOT NULL
|
角色是否可以绕过所有的行级安全性策略,详见Section 5.9。 |
rolconnlimit
|
integerNOT NULL
|
对于可以登录的角色,本列设置该角色可以同时发起最大连接数。-1表示无限制。 |
rolpassword
|
text
|
加密后的密码;如果未设置则为空。其格式取决于所使用的加密方式。 |
rolvaliduntil
|
timestamp with time zone
|
密码过期时间(只用于密码鉴定),如果永不过期则为空 |
演化历史
相邻两个大版本之间的差异,新的在前。版本号链到该版的字段表。
-
PostgreSQL 19 ← 18 仅描述更新
1 处描述更新
rolbypassrlsRole bypasses every row-level security policy, see Section 5.9 for more information. Role bypasses every row-level security policy, see Section 5.10 for more information.
-
PostgreSQL 17 ← 16 仅描述更新
关系说明更新
1 处描述更新
rolbypassrlsRole bypasses every row-level security policy, see Section 5.8 for more information. Role bypasses every row-level security policy, see Section 5.9 for more information.
-
PostgreSQL 14 ← 13 仅描述更新
关系说明更新
1 处描述更新
rolbypassrlsRole bypasses every row level security policy, see Section 5.8 for more information. Role bypasses every row-level security policy, see Section 5.8 for more information.
-
PostgreSQL 13 ← 12 仅描述更新
1 处描述更新
rolpasswordPassword (possibly encrypted); null if none. The format depends on the form of encryption used. Encrypted password; null if none. The format depends on the form of encryption used.
-
PostgreSQL 12 ← 11 结构变更
oid:隐式列 → 常规列2 处描述更新
oidRow identifier (hidden attribute; must be explicitly selected) Row identifierrolbypassrlsRole bypasses every row level security policy, see Section 5.7 for more information. Role bypasses every row level security policy, see Section 5.8 for more information.
-
PostgreSQL 10 ← 9.6 仅描述更新
关系说明更新
1 处描述更新
rolpasswordPassword (possibly encrypted); null if none. If the password is encrypted, this column will begin with the string md5 followed by a 32-character hexadecimal MD5 hash. The MD5 hash will be of the user's password concatenated to their user name. For example, if user joe has password xyzzy, PostgreSQL will store the md5 hash of xyzzyjoe. A password that does not follow that format is assumed to be unencrypted. Password (possibly encrypted); null if none. The format depends on the form of encryption used.
-
PostgreSQL 9.6 ← 9.5 仅描述更新
关系说明更新
1 处描述更新
rolreplicationRole is a replication role. That is, this role can initiate streaming replication (see Section 25.2.5) and set/unset the system backup mode using pg_start_backup and pg_stop_backup Role is a replication role. A replication role can initiate replication connections and create and drop replication slots.
-
PostgreSQL 9.5 ← 9.4 结构变更
rolbypassrlsrolcatupdate1 处描述更新
rolcanloginRole can log in. That is, this role can be given as the initial session authorization identifier Role can log in. That is, this role can be given as the initial session authorization identifier.
-
PostgreSQL 9.3 ← 9.2 仅描述更新
1 处描述更新
oidRow identifier (hidden system attribute; explicitly select oid). Row identifier (hidden attribute; must be explicitly selected)
-
PostgreSQL 9.1 ← 9.0 结构变更
rolreplication1 处描述更新
rolpasswordPassword (possibly encrypted); null if none. If the password is encrypted, this column will contain the string md5 followed by a 32-character hexadecimal MD5 hash. The MD5 hash will be of the user's password concatenated to their username (for example, if user joe has password xyzzy, PostgreSQL will store the md5 hash of xyzzyjoe). Password (possibly encrypted); null if none. If the password is encrypted, this column will begin with the string md5 followed by a 32-character hexadecimal MD5 hash. The MD5 hash will be of the user's password concatenated to their user name. For example, if user joe has password xyzzy, PostgreSQL will store the md5 hash of xyzzyjoe. A password that does not follow that format is assumed to be unencrypted.
字段矩阵
每个字段在 18 个收录版本里的存在情况;方格指向该版的字段表。「有变」指类型、可空、隐式或数组维数与上一版不同。
存在 有变 已移除 不存在
| 字段 | 9.0 | 9.1 | 9.2 | 9.3 | 9.4 | 9.5 | 9.6 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
oid |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 有变 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolname |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolsuper |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolinherit |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolcreaterole |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolcreatedb |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolcatupdate |
存在 | 存在 | 存在 | 存在 | 存在 | 已移除 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 |
rolcanlogin |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolconnlimit |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolpassword |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolvaliduntil |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolreplication |
不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
rolbypassrls |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
系统列
每张表都有的 6 个系统列
tableoidoid-6cmaxcid-5xmaxxid-4cmincid-3xminxid-2ctidtid-1
同类关系
| 关系 | 引入 | 字段 | 版本变动 | 最近变更 |
|---|---|---|---|---|
pg_aggregate |
9.0基线 | 22 | 113 次 | |
| 聚合函数 | 现存 | |||
pg_am |
9.0基线 | 4 | 124 次 | |
| 关系访问方法 | 现存 | |||
pg_amop |
9.0基线 | 9 | 122 次 | |
| 访问方法操作符 | 现存 | |||
pg_amproc |
9.0基线 | 6 | 121 次 | |
| 访问方法支持函数 | 现存 | |||
pg_attrdef |
9.0基线 | 4 | 122 次 | |
| 列默认值 | 现存 | |||
pg_attribute |
9.0基线 | 25 | 189 次 | |
| 表列(“属性”) | 现存 | |||
pg_auth_members |
9.0基线 | 7 | 161 次 | |
| 授权标识符成员关系 | 现存 | |||
pg_authid |
9.0基线 | 12 | 123 次 | |
| 授权标识符(角色) | 现存 | |||
pg_cast |
9.0基线 | 6 | 121 次 | |
| 转换(数据类型转换) | 现存 | |||
pg_class |
9.0基线 | 34 | 189 次 | |
| 表、索引、序列、视图 (“关系”) | 现存 | |||
pg_collation |
9.1 | 12 | 175 次 | |
| 排序规则(区域设置信息) | 现存 | |||
pg_constraint |
9.0基线 | 28 | 187 次 | |
| 检查约束、唯一约束、主键约束、外键约束 | 现存 | |||
pg_conversion |
9.0基线 | 8 | 121 次 | |
| 编码转换信息 | 现存 | |||
pg_database |
9.0基线 | 18 | 175 次 | |
| 本数据库集簇中的数据库 | 现存 | |||
pg_db_role_setting |
9.0基线 | 3 | — | |
| 每角色和每数据库的设置 | 现存 | |||
pg_default_acl |
9.0基线 | 5 | 121 次 | |
| 对象类型的默认权限 | 现存 | |||
pg_depend |
9.0基线 | 7 | — | |
| 数据库对象间的依赖 | 现存 | |||
pg_description |
9.0基线 | 4 | 9.51 次 | |
| 数据库对象上的描述或注释 | 现存 | |||
pg_enum |
9.0基线 | 4 | 122 次 | |
| 枚举标签和值定义 | 现存 | |||
pg_event_trigger |
9.3 | 7 | 121 次 | |
| 事件触发器 | 现存 | |||
pg_extension |
9.1 | 8 | 122 次 | |
| 已安装扩展 | 现存 | |||
pg_foreign_data_wrapper |
9.0基线 | 8 | 193 次 | |
| 外部数据包装器定义 | 现存 | |||
pg_foreign_server |
9.0基线 | 8 | 121 次 | |
| 外部服务器定义 | 现存 | |||
pg_foreign_table |
9.1 | 3 | — | |
| 外部表信息 | 现存 | |||
pg_index |
9.0基线 | 21 | 155 次 | |
| 索引信息 | 现存 | |||
pg_inherits |
9.0基线 | 4 | 141 次 | |
| 表继承层次 | 现存 | |||
pg_init_privs |
9.6 | 5 | — | |
| 对象初始权限 | 现存 | |||
pg_language |
9.0基线 | 9 | 121 次 | |
| 编写函数的语言 | 现存 | |||
pg_largeobject |
9.0基线 | 3 | 9.51 次 | |
| 大对象的数据页 | 现存 | |||
pg_largeobject_metadata |
9.0基线 | 3 | 121 次 | |
| 大对象的元数据 | 现存 | |||
pg_namespace |
9.0基线 | 4 | 121 次 | |
| 模式 | 现存 | |||
pg_opclass |
9.0基线 | 9 | 121 次 | |
| 访问方法操作符类 | 现存 | |||
pg_operator |
9.0基线 | 15 | 121 次 | |
| 操作符 | 现存 | |||
pg_opfamily |
9.0基线 | 5 | 121 次 | |
| 访问方法操作符族 | 现存 | |||
pg_parameter_acl |
15 | 3 | — | |
| 已授予权限的配置参数 | 现存 | |||
pg_partitioned_table |
10 | 8 | 111 次 | |
| 表的分区键的信息 | 现存 | |||
pg_pltemplate |
9.0基线 | 8 | 9.51 次 | |
| 过程语言的模板数据 | 于 13 移除 | |||
pg_policy |
9.5 | 8 | 122 次 | |
| 行安全策略 | 现存 | |||
pg_proc |
9.0基线 | 30 | 147 次 | |
| 函数和过程 | 现存 | |||
pg_propgraph_element |
19 | 14 | — | |
| 属性图元素(顶点和边) | 于 20 移除 | |||
pg_propgraph_element_label |
19 | 3 | — | |
| 属性图中元素与标签之间的链接 | 于 20 移除 | |||
pg_propgraph_label |
19 | 3 | — | |
| 属性图标签 | 于 20 移除 | |||
pg_propgraph_label_property |
19 | 4 | — | |
| 属性图中按标签区分的属性定义 | 于 20 移除 | |||
pg_propgraph_property |
19 | 6 | — | |
| 属性图属性 | 于 20 移除 | |||
pg_publication |
10 | 11 | 195 次 | |
| 用于逻辑复制的发布 | 现存 | |||
pg_publication_namespace |
15 | 3 | — | |
| 模式到发布映射 | 现存 | |||
pg_publication_rel |
10 | 6 | 193 次 | |
| 关系与发布的映射 | 现存 | |||
pg_range |
9.2 | 12 | 192 次 | |
| 范围类型的信息 | 现存 | |||
pg_replication_origin |
9.5 | 2 | — | |
| 已注册的复制源 | 现存 | |||
pg_rewrite |
9.0基线 | 8 | 123 次 | |
| 查询重写规则 | 现存 | |||
pg_seclabel |
9.1 | 5 | 9.51 次 | |
| 数据库对象上的安全标签 | 现存 | |||
pg_sequence |
10 | 8 | — | |
| 有关序列的信息 | 现存 | |||
pg_shdepend |
9.0基线 | 7 | — | |
| 共享对象上的依赖 | 现存 | |||
pg_shdescription |
9.0基线 | 3 | 9.51 次 | |
| 共享对象上的注释 | 现存 | |||
pg_shseclabel |
9.2 | 4 | 9.51 次 | |
| 共享数据库对象上的安全标签 | 现存 | |||
pg_statistic |
9.0基线 | 31 | 122 次 | |
| 规划器统计 | 现存 | |||
pg_statistic_ext |
10 | 9 | 174 次 | |
| 扩展的规划器统计信息(定义) | 现存 | |||
pg_statistic_ext_data |
12 | 6 | 152 次 | |
| 扩展的规划器统计信息(已构建的统计信息) | 现存 | |||
pg_subscription |
10 | 23 | 197 次 | |
| 逻辑复制订阅 | 现存 | |||
pg_subscription_rel |
10 | 4 | 131 次 | |
| 订阅的关系状态 | 现存 | |||
pg_tablespace |
9.0基线 | 5 | 122 次 | |
| 本数据库集簇内的表空间 | 现存 | |||
pg_transform |
9.5 | 5 | 121 次 | |
| 转换(将数据类型转换为过程语言需要的形式) | 现存 | |||
pg_trigger |
9.0基线 | 19 | 135 次 | |
| 触发器 | 现存 | |||
pg_ts_config |
9.0基线 | 5 | 121 次 | |
| 文本搜索配置 | 现存 | |||
pg_ts_config_map |
9.0基线 | 4 | — | |
| 文本搜索配置的词元映射 | 现存 | |||
pg_ts_dict |
9.0基线 | 6 | 121 次 | |
| 文本搜索字典 | 现存 | |||
pg_ts_parser |
9.0基线 | 8 | 121 次 | |
| 文本搜索分析器 | 现存 | |||
pg_ts_template |
9.0基线 | 5 | 121 次 | |
| 文本搜索模板 | 现存 | |||
pg_type |
9.0基线 | 32 | 144 次 | |
| 数据类型 | 现存 | |||
pg_user_mapping |
9.0基线 | 4 | 121 次 | |
| 将用户映射到外部服务器 | 现存 | |||