The pg_user_mappings view provides access to information about user mappings. This view is essentially a public-readble view of the pg_user_mapping system catalog table that omits the options field if the user does not have access rights to view it.

    columntypereferencesdescription
    umidoidpg_user_mapping.oidOID of the user mapping.
    srvidoidpg_foreign_server.oidOID of the foreign server that contains this mapping.
    srvnametextpg_foreign_server.srvnameName of the foreign server.
    umuseroidpg_authid.oidOID of the local role being mapped, 0 if the user mapping is public.
    usenamename Name of the local user to be mapped.
    umoptionstext[] User mapping-specific options, as “keyword=value” strings.

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

    • The current user is the user being mapped, and owns the server or holds USAGE privilege on it.
    • The current user is the server owner and the mapping is for PUBLIC.
    • The current user is a superuser.

    Parent topic: System Catalogs Definitions