- Reference
- Version · 6.0
- Change Automation Reference
renameViewColumnsAndUpdateBody
Last updated: September 29, 2026
The renameViewColumnsAndUpdateBody change type renames one or more columns in a PostgreSQL view and simultaneously updates the view body SQL. It is emitted automatically by diff-changelog when it detects view column renames paired with a body change on PostgreSQL.
Note: Automatic rollback is supported. Liquibase reverses each column rename and restores the original view body SQL. When the restored body has fewer columns than the current view, Liquibase drops and recreates the view instead of replacing it, because PostgreSQL cannot remove columns with CREATE OR REPLACE VIEW. Rollback requires oldBody.
Available attributes
Attribute | Type | Required | Description |
|---|---|---|---|
| String | Yes | Name of the view to update. |
| String | Yes | Comma-separated list of current column names to rename. |
| String | Yes | Comma-separated list of new column names, in the same order as oldColumnNames. |
| String | No | The previous view body SQL. Required for rollback; omit only if you will not roll back this changeset. |
| String | Yes | The new view body SQL to apply. |
| String | No | Direction in which the view's column set shrinks, which requires DROP VIEW and CREATE VIEW instead of CREATE OR REPLACE VIEW. Set to FORWARD when applying the changeset shrinks the view, or ROLLBACK when rolling it back does. diff-changelog sets this automatically. Omit it when the column count does not change. |
| String | No | Name of the schema containing the view. |
| String | No | Name of the catalog containing the view. |