2 .\" Title: ALTER POLICY
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "ALTER POLICY" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 ALTER_POLICY \- change the definition of a row\-level security policy
35 ALTER POLICY \fIname\fR ON \fItable_name\fR RENAME TO \fInew_name\fR
37 ALTER POLICY \fIname\fR ON \fItable_name\fR
38 [ TO { \fIrole_name\fR | PUBLIC | CURRENT_ROLE | CURRENT_USER | SESSION_USER } [, \&.\&.\&.] ]
39 [ USING ( \fIusing_expression\fR ) ]
40 [ WITH CHECK ( \fIcheck_expression\fR ) ]
45 changes the definition of an existing row\-level security policy\&. Note that
47 only allows the set of roles to which the policy applies and the
51 expressions to be modified\&. To change other properties of a policy, such as the command to which it applies or whether it is permissive or restrictive, the policy must be dropped and recreated\&.
54 \fBALTER POLICY\fR, you must own the table that the policy applies to\&.
57 \fBALTER POLICY\fR, the role list,
58 \fIusing_expression\fR, and
59 \fIcheck_expression\fR
60 are replaced independently if specified\&. When one of those clauses is omitted, the corresponding part of the policy is unchanged\&.
65 The name of an existing policy to alter\&.
70 The name (optionally schema\-qualified) of the table that the policy is on\&.
75 The new name for the policy\&.
80 The role(s) to which the policy applies\&. Multiple roles can be specified at one time\&. To apply the policy to all roles, use
84 \fIusing_expression\fR
88 expression for the policy\&. See
89 CREATE POLICY (\fBCREATE_POLICY\fR(7))
93 \fIcheck_expression\fR
97 expression for the policy\&. See
98 CREATE POLICY (\fBCREATE_POLICY\fR(7))
108 CREATE POLICY (\fBCREATE_POLICY\fR(7)), DROP POLICY (\fBDROP_POLICY\fR(7))