SYSTEM VIEW系统视图
pg_user
数据库用户
系统视图 引入 9.0(基线) 现存至 20 devel 3 次结构变更
版本轨迹
相对 PostgreSQL 17 无变化。
视图pg_user提供数据库用户的信息。它本质上是 pg_shadow 的公开可读视图,并将密码字段清空。
字段
PostgreSQL 18 的 9 个字段,按定义顺序排列。说明默认用本站手册的译文,没有译文的按英文原文显示。
| 字段 | 类型 | 说明 |
|---|---|---|
usename
|
name
|
用户名 |
usesysid
|
oid
|
用户的ID |
usecreatedb
|
boolean
|
用户可创建数据库 |
usesuper
|
boolean
|
用户为一个超级用户 |
userepl
|
boolean
|
用户可开启流复制并将系统设置或者取消备份模式。 |
usebypassrls
|
boolean
|
用户能否绕过所有的行级安全性策略,详见Section 5.9。 |
passwd
|
text
|
不是密码(始终显示为 ********) |
valuntil
|
timestamp with time zone
|
密码过期时间(仅用于密码认证) |
useconfig
|
text[]
|
运行时配置变量的会话默认值 |
演化历史
相邻两个大版本之间的差异,新的在前。版本号链到该版的字段表。
-
PostgreSQL 19 ← 18 仅描述更新
1 处描述更新
usebypassrlsUser bypasses every row-level security policy, see Section 5.9 for more information. User bypasses every row-level security policy, see Section 5.10 for more information.
-
PostgreSQL 17 ← 16 仅描述更新
1 处描述更新
usebypassrlsUser bypasses every row-level security policy, see Section 5.8 for more information. User bypasses every row-level security policy, see Section 5.9 for more information.
-
PostgreSQL 14 ← 13 仅描述更新
1 处描述更新
usebypassrlsUser bypasses every row level security policy, see Section 5.8 for more information. User bypasses every row-level security policy, see Section 5.8 for more information.
-
PostgreSQL 12 ← 11 结构变更
valuntil:abstime → timestamp with time zone1 处描述更新
usebypassrlsUser bypasses every row level security policy, see Section 5.7 for more information. User bypasses every row level security policy, see Section 5.8 for more information.
-
PostgreSQL 9.5 ← 9.4 结构变更
usebypassrlsusecatupd -
PostgreSQL 9.2 ← 9.1 仅描述更新
1 处描述更新
usesysidUser ID (arbitrary number used to reference this user) ID of this user
-
PostgreSQL 9.1 ← 9.0 结构变更
userepl
字段矩阵
每个字段在 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
usename |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
usesysid |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
usecreatedb |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
usesuper |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
usecatupd |
存在 | 存在 | 存在 | 存在 | 存在 | 已移除 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 |
passwd |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
valuntil |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 有变 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
useconfig |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
userepl |
不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
usebypassrls |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
同类关系
| 关系 | 引入 | 字段 | 版本变动 | 最近变更 |
|---|---|---|---|---|
pg_aios |
18 | 15 | — | |
| 正在使用的异步 I/O 句柄 | 现存 | |||
pg_available_extension_versions |
9.1 | 10 | 192 次 | |
| 扩展的可用版本 | 现存 | |||
pg_available_extensions |
9.1 | 5 | 191 次 | |
| 可用的扩展 | 现存 | |||
pg_backend_memory_contexts |
14 | 10 | 181 次 | |
| 后端内存上下文 | 现存 | |||
pg_config |
9.6 | 2 | — | |
| 编译时配置参数 | 现存 | |||
pg_cursors |
9.0基线 | 6 | — | |
| 打开的游标 | 现存 | |||
pg_dsm_registry_allocations |
19 | 3 | — | |
| DSM 注册表跟踪的共享内存分配 | 现存 | |||
pg_file_settings |
9.5 | 7 | — | |
| 配置文件内容摘要 | 现存 | |||
pg_group |
9.0基线 | 3 | — | |
| 数据库用户组 | 现存 | |||
pg_hba_file_rules |
10 | 11 | 161 次 | |
| 客户端认证配置文件内容的摘要 | 现存 | |||
pg_ident_file_mappings |
15 | 7 | 161 次 | |
| 客户端用户名映射配置文件内容摘要 | 现存 | |||
pg_indexes |
9.0基线 | 5 | — | |
| 索引 | 现存 | |||
pg_locks |
9.0基线 | 16 | 142 次 | |
| 当前持有或等待的锁 | 现存 | |||
pg_matviews |
9.3 | 7 | — | |
| 物化视图 | 现存 | |||
pg_policies |
9.5 | 8 | 101 次 | |
| 策略 | 现存 | |||
pg_prepared_statements |
9.0基线 | 8 | 162 次 | |
| 预备语句 | 现存 | |||
pg_prepared_xacts |
9.0基线 | 5 | — | |
| 预备事务 | 现存 | |||
pg_publication_sequences |
19 | 3 | — | |
| 发布及其关联序列的信息 | 现存 | |||
pg_publication_tables |
10 | 5 | 151 次 | |
| 发布及其关联表的信息 | 现存 | |||
pg_replication_origin_status |
9.5 | 4 | — | |
| 有关复制源的信息,包括复制进度 | 现存 | |||
pg_replication_slots |
9.4 | 22 | 199 次 | |
| 复制槽信息 | 现存 | |||
pg_roles |
9.0基线 | 13 | 9.52 次 | |
| 数据库角色 | 现存 | |||
pg_rules |
9.0基线 | 4 | — | |
| 规则 | 现存 | |||
pg_seclabels |
9.1 | 8 | — | |
| 安全标签 | 现存 | |||
pg_sequences |
10 | 11 | — | |
| 序列 | 现存 | |||
pg_settings |
9.0基线 | 17 | 9.51 次 | |
| 参数设置 | 现存 | |||
pg_shadow |
9.0基线 | 9 | 123 次 | |
| 数据库用户 | 现存 | |||
pg_shmem_allocations |
13 | 4 | — | |
| 共享内存分配 | 现存 | |||
pg_shmem_allocations_numa |
18 | 3 | — | |
| 共享内存分配的 NUMA 节点映射 | 现存 | |||
pg_stats |
9.0基线 | 19 | 193 次 | |
| 规划器统计信息 | 现存 | |||
pg_stats_ext |
12 | 17 | 193 次 | |
| 扩展规划器统计信息 | 现存 | |||
pg_stats_ext_exprs |
14 | 22 | 192 次 | |
| 表达式的扩展规划器统计信息 | 现存 | |||
pg_tables |
9.0基线 | 8 | 9.51 次 | |
| 表 | 现存 | |||
pg_timezone_abbrevs |
9.0基线 | 3 | — | |
| 时区简写 | 现存 | |||
pg_timezone_names |
9.0基线 | 4 | — | |
| 时区名称 | 现存 | |||
pg_user |
9.0基线 | 9 | 123 次 | |
| 数据库用户 | 现存 | |||
pg_user_mappings |
9.0基线 | 6 | — | |
| 用户映射 | 现存 | |||
pg_views |
9.0基线 | 4 | — | |
| 视图 | 现存 | |||
pg_wait_events |
17 | 3 | — | |
| 等待事件 | 现存 | |||