renameRowAccessPolicy

Renames an existing row access policy in Snowflake. Can also move the policy to a different schema or database.

Note: Automatic rollback renames the policy back to original name.

Known limitation: This change type does not support database inspection features (snapshot, diff, diff-changelog, and generate-changelog commands).

Available attributes

Attribute

Type

Description

Required

catalogName

String

Name of the catalog (database) containing the policy

No

schemaName

String

Name of the schema containing the policy

No

oldPolicyName

String

Current name of the row access policy

Yes

ifExists

Boolean

Only rename if the policy exists using IF EXISTS

No

newCatalogName

String

Name of the target catalog (for moving across databases)

No

newSchemaName

String

Name of the target schema (for moving across schemas)

No

newPolicyName

String

New name for the row access policy

Yes

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:pro-snowflake="http://www.liquibase.org/xml/ns/pro-snowflake"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
        http://www.liquibase.org/xml/ns/pro-snowflake
        http://www.liquibase.org/xml/ns/pro-snowflake/liquibase-pro-snowflake-latest.xsd">
  <!-- Basic rename -->
  <changeSet id="rename-row-access-policy-basic" author="examples">
    <pro-snowflake:renameRowAccessPolicy
                oldPolicyName="LEGACY_ACCESS_POLICY"
                newPolicyName="DEPARTMENT_ACCESS_POLICY"/>
  </changeSet>
  <!-- Rename with IF EXISTS -->
  <changeSet id="rename-row-access-policy-if-exists" author="examples">
    <pro-snowflake:renameRowAccessPolicy
                oldPolicyName="OLD_TENANT_POLICY"
                newPolicyName="TENANT_ISOLATION_POLICY"
                ifExists="true"/>
  </changeSet>
  <!-- Move to different schema -->
  <changeSet id="rename-row-access-policy-move-schema" author="examples">
    <pro-snowflake:renameRowAccessPolicy
                oldPolicyName="TEMP_POLICY"
                newSchemaName="PRODUCTION"
                newPolicyName="PRODUCTION_ACCESS_POLICY"/>
  </changeSet>
</databaseChangeLog>