52.96. pg_user_mappings

Представление pg_user_mappings открывает доступ к информации о сопоставлениях пользователей. По сути это просто доступное для чтения всеми отображение pg_user_mapping, в котором поле параметров показывается, только если у пользователя есть права читать его.

Таблица 52.97. Столбцы pg_user_mappings

Тип столбца

Описание

umid oid (ссылается на pg_user_mapping.oid)

OID сопоставления пользователей

srvid oid (ссылается на pg_foreign_server.oid)

OID стороннего сервера, содержащего это сопоставление

srvname name (ссылается на pg_foreign_server.srvname)

Имя стороннего сервера

umuser oid (ссылается на pg_authid.oid)

OID сопоставляемой локальной роли, либо ноль, если сопоставление задаётся для всех

usename name

Имя локального пользователя, для которого задано сопоставление

umoptions text[]

Специальные параметры сопоставления пользователей, в виде строк «ключ=значение»


Для защиты информации о паролях, хранящейся в свойствах сопоставления пользователей, столбец umoptions при чтении будет содержать не NULL, если только выполняется одно из этих условий:

  • текущий пользователь является объектом сопоставления и владельцем сервера или имеет право USAGE для него

  • текущий пользователь является владельцем сервера и прочитывается сопоставление для PUBLIC

  • текущий пользователь является суперпользователем

52.96. pg_user_mappings

The view pg_user_mappings provides access to information about user mappings. This is essentially a publicly readable view of pg_user_mapping that leaves out the options field if the user has no rights to use it.

Table 52.97. pg_user_mappings Columns

Column Type

Description

umid oid (references pg_user_mapping.oid)

OID of the user mapping

srvid oid (references pg_foreign_server.oid)

The OID of the foreign server that contains this mapping

srvname name (references pg_foreign_server.srvname)

Name of the foreign server

umuser oid (references pg_authid.oid)

OID of the local role being mapped, or zero if the user mapping is public

usename name

Name of the local user to be mapped

umoptions text[]

User mapping specific options, as keyword=value strings


To protect password information stored as a user mapping option, the umoptions column will read as null unless one of the following applies:

  • current user is the user being mapped, and owns the server or holds USAGE privilege on it

  • current user is the server owner and mapping is for PUBLIC

  • current user is a superuser