PostgresReservedKeywords

This check disallows Postgres reserved keywords from being used in database object names. See the SQL Key Words Appendix for complete list of keywords.

  • Checks require specific parameters noted in the table.
  • Customizations to the list are available to the user, and are stored in the liquibase.checks-settings file.

Uses

Use the check to ensure that no Postgres reserved keywords are used to name database objects. Postgres has reserved certain words for potential future internal purposes, and using these words can cause unexpected consequences when deploying database schema changes or data. These name conflicts can result in job failures from multiple tools in your tool devOps chain. There still may be instances where you are certain you need to use reserved keywords, and understand the implications. To enable this, the quality check can be customized with an Allowed List. This quality check, like other checks, can be configured with a severity level which returns an exit code designed to stop automated jobs, giving your team time to make sure database objects.

Run the PostgresReservedKeywords check

To run the PostgresReservedKeywords check, ensure you have a Liquibase Pro license and the checks-scope property includes changelog. The checks-scope parameter is set in the default properties file, environment variable, or any standard method. Then, check the changelog to see if PostgresReservedKeywords is enabled.

Note: Please be aware that PostgresReservedKeywords only supports modeled changeset types. If you use this Quality Check with unmodeled changesets (formatted SQL changelogs as well as sql and sqlFile changeTypes), a message will appear stating the changeset was skipped.

Enable the PostgresReservedKeywords check by running the following command in the CLI:

liquibase checks enable --check-name=PostgresReservedKeywords
Short Name Scope Enabled Severity Customization Description
PostgresReservedKeywords changelog

false

Default value: 0

  • 'INFO' | 0
  • 'MINOR' | 1
  • 'MAJOR' | 2
  • 'CRITICAL' | 3
  • 'BLOCKER' | 4

OBJECT_TYPES = null

ALLOWED_LIST = null

CASE_SENSITIVE = true

This check disallows Postgres reserved keywords from being used in database object names. See https://www.postgresql.org/docs/14/sql-keywords-appendix.html for complete list of keywords.