ALTER ACCESS POLICY

Performs one of the following actions on existing access policies:

  • Modify an access policy by changing its expression, and by enabling/disabling the policy.
  • Copy an access policy from one table to another.

Syntax

Parameters

[database.]schema

Specifies a schema, by default public. If schema is any schema other than public, you must supply the schema name. For example:

myschema.thisDbObject

If you specify a database, it must be the current database.

table

The name of the table that contains the access policy you want to enable, disable, or copy.

FOR COLUMN column [expression]

Replaces the access policy expression that was previously set for this column. Omit expression from the FOR COLUMN clause in order to enable or disable this policy only, or copy it to another table.

FOR ROWS [WHERE expression]

Replaces the row access policy expression that was previously set for this table. Omit WHERE expression from the FOR ROWS clause in order to enable or disable this policy only, or copy it to another table.

ENABLE | DISABLE Indicates whether to enable or disable the access policy at the table level.
COPY TO TABLE tablename

Copies the existing access policy to the specified table. The copied access policy includes its enabled/disabled status.

The following requirements apply:

  • Copying a column access policy:
    • The target table must have a column of the same name and compatible data type.
    • The target colum must not have an access policy.
  • Copying a row access policy: The target table must not have an access policy.

Privileges

Superuser

Examples

See Managing Access Policies

See Also

CREATE ACCESS POLICY