DROP_POLICY(7pg13)
πΈ NAME πΈ
DROP POLICY β remove a row level security policy from a table. This is the manual page for DROP_POLICY(7pg13) (also known as DROP POLICY(7)), straight from the PostgreSQL 13.23 documentation, and yes you're in the right place, bestie. π
β¨ SYNOPSIS β¨
okay so the whole vibe is this one line:
DROP POLICY [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
π DESCRIPTION π
okay so DROP POLICY removes the specified policy from the table. That's the main character move. π
Note that if the last policy is removed for a table and the table still has row level security enabled via ALTER TABLE, then the default-deny policy will be used. π
ALTER TABLE ... DISABLE ROW LEVEL SECURITY can be used to disable row level security for a table, whether policies for the table exist or not. β¨
π PARAMETERS π
IF EXISTSβ do not throw an error if the policy does not exist. A notice is issued in this case. π«Άnameβ the name of the policy to drop. πtable_nameβ the name (optionally schema-qualified) of the table that the policy is on. πCASCADEβ does not have any effect, since there are no dependencies on policies. πRESTRICTβ does not have any effect, since there are no dependencies on policies. π
π¦ EXAMPLES π¦
To drop the policy called p1 on the table named my_table, you literally run:
DROP POLICY p1 ON my_table;
slay. that's it. π¦
β COMPATIBILITY β
DROP POLICY is a PostgreSQL extension. periodt. π
π SEE ALSO π
CREATE POLICY (CREATE_POLICY(7)), ALTER POLICY (ALTER_POLICY(7)) β go read those too, bestie. iykyk π¦
mwah π β that's the DROP POLICY(7) page from PostgreSQL 13.23, dated 2025. now go drop that policy, bestie π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-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