DROP POLICY <refpurpose>remove a row-level security policy from a table</refpurpose> — テーブルから行単位のセキュリティポリシーを削除する
DROP POLICY [ IF EXISTS ]nameONtable_name[ CASCADE | RESTRICT ]
<command>DROP POLICY</command> removes the specified policy from the table.
Note that if the last policy is removed for a table and the table still has
row-level security enabled via <command>ALTER TABLE</command>, then the
default-deny policy will be used. <literal>ALTER TABLE ... DISABLE ROW
LEVEL SECURITY</literal> can be used to disable row-level security for a
table, whether policies for the table exist or not.
DROP POLICYはテーブルから指定したポリシーを削除します。
テーブルの最後のポリシーが削除され、そのテーブルではまだALTER TABLEによる行単位セキュリティが有効な場合は、デフォルト拒否のポリシーが使われることに注意して下さい。
テーブルのポリシーの存在の有無に関わらず、ALTER TABLE ... DISABLE ROW LEVEL SECURITYを使い、テーブルの行単位セキュリティを無効にすることができます。
IF EXISTSDo not throw an error if the policy does not exist. A notice is issued in this case. ポリシーが存在しない時にエラーを発生させません。 この場合、注意が発行されます。
nameThe name of the policy to drop. 削除するポリシーの名前です。
table_nameThe name (optionally schema-qualified) of the table that the policy is on. ポリシーが適用されているテーブルの名前(スキーマ修飾可)です。
CASCADERESTRICTThese key words do not have any effect, since there are no dependencies on policies. これらのキーワードには何の効果もありません。 ポリシーには依存関係がないからです。
To drop the policy called <literal>p1</literal> on the table named
<literal>my_table</literal>:
my_tableという名前のテーブル上のp1というポリシーを削除するには、次のようにします。
DROP POLICY p1 ON my_table;
<command>DROP POLICY</command> is a <productname>PostgreSQL</productname> extension.
DROP POLICYはPostgreSQLの拡張です。