ALTER POLICY <refpurpose>change the definition of a row-level security policy</refpurpose> — 行単位のセキュリティポリシーの定義を変更する
ALTER POLICYnameONtable_nameRENAME TOnew_nameALTER POLICYnameONtable_name[ TO {role_name| PUBLIC | CURRENT_ROLE | CURRENT_USER | SESSION_USER } [, ...] ] [ USING (using_expression) ] [ WITH CHECK (check_expression) ]
<command>ALTER POLICY</command> changes the definition of an existing
row-level security policy. Note that <command>ALTER POLICY</command>
only allows the set of roles to which the policy applies and the
<literal>USING</literal> and <literal>WITH CHECK</literal> expressions to
be modified. To change other properties of a policy, such as the command
to which it applies or whether it is permissive or restrictive, the policy
must be dropped and recreated.
ALTER POLICYは既存の行単位のセキュリティポリシーの定義を変更します。
ALTER POLICYはポリシーが適用されるロールの集合、およびUSINGとWITH CHECKの式を変更できるだけであることに注意してください。
適用されるコマンドや、許容と制限の別といったその他のポリシーの属性を変更するには、ポリシーを削除して再作成しなければなりません。
To use <command>ALTER POLICY</command>, you must own the table that
the policy applies to.
ALTER POLICYを使うには、ポリシーの適用対象のテーブルの所有者でなければなりません。
In the second form of <command>ALTER POLICY</command>, the role list,
<replaceable class="parameter">using_expression</replaceable>, and
<replaceable class="parameter">check_expression</replaceable> are replaced
independently if specified. When one of those clauses is omitted, the
corresponding part of the policy is unchanged.
ALTER POLICYの2番目の構文で、ロールのリスト、using_expression、check_expressionが指定された時は、それぞれ独立して置換されます。
それらの1つが省略された場合、ポリシーのその部分については変更されません。
nameThe name of an existing policy to alter. 変更対象の既存のポリシーの名前です。
table_nameThe name (optionally schema-qualified) of the table that the policy is on. ポリシーが適用されているテーブルの名前(スキーマ修飾可)です。
new_nameThe new name for the policy. ポリシーの新しい名前です。
role_name
The role(s) to which the policy applies. Multiple roles can be
specified at one time. To apply the policy to all roles,
use <literal>PUBLIC</literal>.
ポリシーの適用対象のロールです。
複数のロールを一度に指定することができます。
ポリシーをすべてのロールに適用するには、PUBLICを指定します。
using_expression
The <literal>USING</literal> expression for the policy.
See <xref linkend="sql-createpolicy"/> for details.
ポリシーのUSING式です。
詳しくはCREATE POLICYを参照して下さい。
check_expression
The <literal>WITH CHECK</literal> expression for the policy.
See <xref linkend="sql-createpolicy"/> for details.
ポリシーのWITH CHECK式です。
詳しくはCREATE POLICYを参照して下さい。
<command>ALTER POLICY</command> is a <productname>PostgreSQL</productname> extension.
ALTER POLICYはPostgreSQLの拡張です。