DROP_POLICY(7pg13)

πŸ“¦ version 13.23, in opensuse-leap 16.0

🌸 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