1ALTER POLICY(7)          PostgreSQL 13.4 Documentation         ALTER POLICY(7)
2
3
4

NAME

6       ALTER_POLICY - change the definition of a row level security policy
7

SYNOPSIS

9       ALTER POLICY name ON table_name RENAME TO new_name
10
11       ALTER POLICY name ON table_name
12           [ TO { role_name | PUBLIC | CURRENT_USER | SESSION_USER } [, ...] ]
13           [ USING ( using_expression ) ]
14           [ WITH CHECK ( check_expression ) ]
15

DESCRIPTION

17       ALTER POLICY changes the definition of an existing row-level security
18       policy. Note that ALTER POLICY only allows the set of roles to which
19       the policy applies and the USING and WITH CHECK expressions to be
20       modified. To change other properties of a policy, such as the command
21       to which it applies or whether it is permissive or restrictive, the
22       policy must be dropped and recreated.
23
24       To use ALTER POLICY, you must own the table that the policy applies to.
25
26       In the second form of ALTER POLICY, the role list, using_expression,
27       and check_expression are replaced independently if specified. When one
28       of those clauses is omitted, the corresponding part of the policy is
29       unchanged.
30

PARAMETERS

32       name
33           The name of an existing policy to alter.
34
35       table_name
36           The name (optionally schema-qualified) of the table that the policy
37           is on.
38
39       new_name
40           The new name for the policy.
41
42       role_name
43           The role(s) to which the policy applies. Multiple roles can be
44           specified at one time. To apply the policy to all roles, use
45           PUBLIC.
46
47       using_expression
48           The USING expression for the policy. See CREATE POLICY
49           (CREATE_POLICY(7)) for details.
50
51       check_expression
52           The WITH CHECK expression for the policy. See CREATE POLICY
53           (CREATE_POLICY(7)) for details.
54

COMPATIBILITY

56       ALTER POLICY is a PostgreSQL extension.
57

SEE ALSO

59       CREATE POLICY (CREATE_POLICY(7)), DROP POLICY (DROP_POLICY(7))
60
61
62
63PostgreSQL 13.4                      2021                      ALTER POLICY(7)
Impressum