DROP POLICY

|        DROP POLICY        |                       |            |                  |                               |
|:-------------------------:|-----------------------|------------|------------------|-------------------------------|
|[Prev](sql-drop-owned.html)|[Up](sql-commands.html)|SQL Commands|[Home](index.html)| [Next](sql-dropprocedure.html)|

---

[]()

## DROP POLICY

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. 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`  
`RESTRICT`

 These key words do not have any effect, since there are no dependencies on policies.

## 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](sql-createpolicy.html), [ALTER POLICY](sql-alterpolicy.html)

---

|[Prev](sql-drop-owned.html)|[Up](sql-commands.html)| [Next](sql-dropprocedure.html)|
|:--------------------------|:---------------------:|------------------------------:|
|        DROP OWNED         |  [Home](index.html)   |         DROP PROCEDURE        |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>