-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sequenceExists became case sensitive from 4.24 on #5832
Comments
Hi @davidecavestro, thank you for reporting this issue. I have been able to replicate the bug. The source of this seems to be that when creating the sequence, its name is automatically set to lowercase, but the precondition query doesn't do that. A workaround is using the lowercase name in your preconditions. We'll be leaving this issue open for the community to propose a fix for. Our develompent team will be available to provide guidance if necessary. Thank you, |
Please note it seems a regression, as it used to work with previous versions, and it possibly affects checks on other object types. That said, I can dissect history to find where and why the behavior changed, so that we understand which fix makes sense. |
@tati-qalified after a quick check, I suppose the regression has been inadvertedly introduced with PR #4613, and specifically with the SQL query introduced as constant |
@davidecavestro would you be willing to propose a fix and submit a PR? |
Search first
Description
We were used to create sequences using uppercase name on changesets, as this is automatically transalted to lowercase for postgres. After switching Liquibase from 4.11 to 4.27 we noticed it fails to recognize existing sequences
Steps To Reproduce
Given a docker compose file creating a postgres db on ephemeral storage, and launching liquibase on it as follows
compose.yml:
if the changeset creates a sequence having uppercase name and afterwards tests for its existence using the same uppercase name, it fails, as the sequence is by default translated to its lowercase counterpart by the db engine.
This fails with liquibase versions from 4.24 to 4.27, while with 4.23 it works
changelog.xml:
Expected/Desired Behavior
The sequence created by liquibase should be found by the precondition with default settings, otherwise there's a breaking change preventing us to upgrade liquibase.
Liquibase Version
4.27
Database Vendor & Version
PostgreSQL 16.2
Liquibase Integration
CLI
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
official docker image
Additional Context
It also sworks on Liquibase 4.11.
It probably fails also for Oracle, using lowercase names (not tested yet).
This case sensitivity issue possibly affects other checks, though we've not tested yet.
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: