バージョンごとのドキュメント一覧

53.8. pg_authid #

The catalog <structname>pg_authid</structname> contains information about database authorization identifiers (roles). A role subsumes the concepts of <quote>users</quote> and <quote>groups</quote>. A user is essentially just a role with the <structfield>rolcanlogin</structfield> flag set. Any role (with or without <structfield>rolcanlogin</structfield>) can have other roles as members; see <link linkend="catalog-pg-auth-members"><structname>pg_auth_members</structname></link>. pg_authidカタログはデータベース認証識別子(ロール)の情報を保持します。 ロールはユーザグループの概念を包括しています。 ユーザは本質的にrolcanloginフラグセットを持ったロールです。 どのようなロール(rolcanloginを持っている、持っていないに関わらず)も他のロールをメンバとして持っていても構いません。 pg_auth_membersを参照してください。

Since this catalog contains passwords, it must not be publicly readable. <link linkend="view-pg-roles"><structname>pg_roles</structname></link> is a publicly readable view on <structname>pg_authid</structname> that blanks out the password field. このカタログはパスワードを含んでいるため、第三者が内容を読むことができないようにしなければいけません。 pg_rolesは、pg_authidのビューで、パスワードのフィールドは空白となっていますので内容を読み取ることができます。

<xref linkend="user-manag"/> contains detailed information about user and privilege management. 第22章でユーザと権限管理に関するより詳細について説明します。

Because user identities are cluster-wide, <structname>pg_authid</structname> is shared across all databases of a cluster: there is only one copy of <structname>pg_authid</structname> per cluster, not one per database. ユーザの本人確認はクラスタ全体にわたる情報ですので、pg_authidはクラスタのすべてのデータベースで共有されます。 データベース毎ではなく、クラスタ毎にたった1つだけpg_authidが存在します。

表53.8 pg_authidの列

<title><structname>pg_authid</structname> Columns</title>

Column Type 列 型

Description 説明

oid oid

Row identifier 行識別子

rolname name

Role name ロール名

rolsuper bool

Role has superuser privileges ロールはスーパーユーザの権限を持っている

rolinherit bool

Role automatically inherits privileges of roles it is a member of ロールは自動的にメンバとして属するロールの権限を継承

rolcreaterole bool

Role can create more roles ロールはロールを作成できる

rolcreatedb bool

Role can create databases ロールはデータベースを作成できる

rolcanlogin bool

Role can log in. That is, this role can be given as the initial session authorization identifier. ロールはログインできる。つまりロールはセッションを始める認証の識別子となることができます。

rolreplication bool

Role is a replication role. A replication role can initiate replication connections and create and drop replication slots. ロールはレプリケーションのロールである。 レプリケーションロールは、レプリケーション接続を開始すること、およびレプリケーションスロットを作成および削除できます。

rolbypassrls bool

Role bypasses every row-level security policy, see <xref linkend="ddl-rowsecurity"/> for more information. すべての行単位セキュリティポリシーを無視するロール。詳しくは5.8を参照してください。

rolconnlimit int4

For roles that can log in, this sets maximum number of concurrent connections this role can make. -1 means no limit. ログイン可能なロールでは、これはロールが確立できる同時実行接続数を設定します。 -1は制限無しを意味します。

rolpassword text

Password (possibly encrypted); null if none. The format depends on the form of encryption used. (おそらく暗号化された)パスワード。無い場合はNULLです。 書式は使用される暗号化の形式に依存します。

rolvaliduntil timestamptz

Password expiry time (only used for password authentication); null if no expiration パスワード有効期限(パスワード認証でのみ使用)。 NULLの場合には満了時間はありません。


For an MD5 encrypted password, <structfield>rolpassword</structfield> column will begin with the string <literal>md5</literal> 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 <literal>joe</literal> has password <literal>xyzzy</literal>, <productname>PostgreSQL</productname> will store the md5 hash of <literal>xyzzyjoe</literal>. MD5で暗号化されたパスワードでは、rolpassword列は文字列md5で始まり、それに32文字の16進MD5ハッシュ値が続きます。 MD5ハッシュは、ユーザのパスワードとユーザ名を繋げたものに対して生成されます。 例えばjoeのパスワードがxyzzyなら、PostgreSQLxyzzyjoeのMD5ハッシュを格納します。

If the password is encrypted with SCRAM-SHA-256, it has the format: パスワードがSCRAM-SHA-256で暗号化される場合、次の書式になります。

SCRAM-SHA-256$<iteration count>:<salt>$<StoredKey>:<ServerKey>

where <replaceable>salt</replaceable>, <replaceable>StoredKey</replaceable> and <replaceable>ServerKey</replaceable> are in Base64 encoded format. This format is the same as that specified by <ulink url="https://tools.ietf.org/html/rfc5803">RFC 5803</ulink>. ここで、saltStoredKeyServerKeyはBase64の符号化書式に従います。 この書式はRFC 5803で指定されているものと同じです。

A password that does not follow either of those formats is assumed to be unencrypted. これらのいずれの書式にも従っていないパスワードは、暗号化されていないものとみなされます。