DROP_POLICY(7pg17)
π DROP POLICY π
okay so this is the DROP POLICY(7) page from the PostgreSQL 17.11 docs, and it's literally the βbye bye, row-level security policyβ page. Pull up a chair, bestie π«Ά
πΈ NAME πΈ
DROP_POLICY β remove a row-level security policy from a table.
β¨ SYNOPSIS β¨
DROP POLICY [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
π¦ DESCRIPTION π¦
DROP POLICY removes the specified policy from the table. Periodt.
Important vibe check: if you remove the last policy for a table and that table still has row-level security enabled via ALTER TABLE, then the default-deny policy will be used. No cap β default-deny is the main character then. π
If you want to turn row-level security off for a table, ALTER TABLE ... DISABLE ROW LEVEL SECURITY can be used β whether policies for the table exist or not. Slay.
π PARAMETERS π
IF EXISTSβ do not throw an error if the policy does not exist. A notice is issued in this case, so you get a lil heads-up instead of a whole crash-out.nameβ the name of the policy to drop.table_nameβ the name (optionally schema-qualified) of the table that the policy is on.CASCADE,RESTRICTβ these key words do not have any effect, since there are no dependencies on policies. They're just there, being iconic and doing absolutely nothing. π
π EXAMPLES π
To drop the policy called p1 on the table named my_table:
DROP POLICY p1 ON my_table;
π COMPATIBILITY π
DROP POLICY is a PostgreSQL extension.
π SEE ALSO π
CREATE POLICY(CREATE_POLICY(7))ALTER POLICY(ALTER_POLICY(7))
mwah π this page is from PostgreSQL 17.11, dated 2026, and it's the DROP POLICY(7) manual page. bye bestie, go drop those policies responsibly π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms