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

53.38. pg_policy #

The catalog <structname>pg_policy</structname> stores row-level security policies for tables. A policy includes the kind of command that it applies to (possibly all commands), the roles that it applies to, the expression to be added as a security-barrier qualification to queries that include the table, and the expression to be added as a <literal>WITH CHECK</literal> option for queries that attempt to add new records to the table. カタログpg_policyはテーブルの行単位セキュリティのポリシーを格納します。 ポリシーには、それが適用されるコマンドの種類(すべてのコマンドのこともあります)、それが適用されるロール、セキュリティバリアの制約として、そのテーブルを含む問い合わせに追加される式、そしてテーブルに新しいレコードを追加しようとする問い合わせのためにWITH CHECKオプションとして追加される式が含まれます。

表53.38 pg_policyの列

<title><structname>pg_policy</structname> Columns</title>

Column Type 列 型

Description 説明

oid oid

Row identifier 行識別子

polname name

The name of the policy ポリシーの名前

polrelid oid (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>) (参照先 pg_class.oid

The table to which the policy applies ポリシーが適用されるテーブル

polcmd char

The command type to which the policy is applied: <literal>r</literal> for <xref linkend="sql-select"/>, <literal>a</literal> for <xref linkend="sql-insert"/>, <literal>w</literal> for <xref linkend="sql-update"/>, <literal>d</literal> for <xref linkend="sql-delete"/>, or <literal>*</literal> for all ポリシーが適用されるコマンドの種類: r = SELECTa = INSERTw = UPDATEd = DELETE* = すべて

polpermissive bool

Is the policy permissive or restrictive? 許容(permissive)ポリシーか、制限(restrictive)ポリシーか

polroles oid[] (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>) (参照先 pg_authid.oid

The roles to which the policy is applied; zero means <literal>PUBLIC</literal> (and normally appears alone in the array) ポリシーが適用されるロール。ゼロならPUBLIC(通常配列中に単独で現れます)

polqual pg_node_tree

The expression tree to be added to the security barrier qualifications for queries that use the table テーブルを使用する問い合わせにセキュリティバリアの制約として追加される式のツリー

polwithcheck pg_node_tree

The expression tree to be added to the WITH CHECK qualifications for queries that attempt to add rows to the table テーブルに行を追加する問い合わせにWITH CHECKの制約として追加される式のツリー


注記

Policies stored in <structname>pg_policy</structname> are applied only when <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relrowsecurity</structfield> is set for their table. pg_policyに格納されるポリシーは、そのテーブルにpg_class.relrowsecurityが設定されている場合にのみ適用されます。