-
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
Postgresql: Fix for case when current search_path is an empty string #3233
Postgresql: Fix for case when current search_path is an empty string #3233
Conversation
…us when running postgres with testcontainers for IT tests)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review and test results:
Things to be aware of:
- Changes make sense to me, it's keeping an invalid search_path with a trailing , from being made
- Probably not a code path that gets hit in our code's setup, and not something that is easy to write a test for at this point. But existing tests should catch anything surprising it breaks.
- Functional test failures are unrelated to this change
Things to worry about:
- Nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR fixes a bug to prevent empty Postgres SEARCH_PATH values from being set. In the case where the SEARCH_PATH is empty, Liquibase will use the default schema as the SEARCH_PATH.
APPROVED
Note: Functional test failures on DB2 LUW and MariaDB are due to test validations out of sync with current Liquibase master; this is not related to this PR (which only impacts Postgres, which is passing).
Thanks for your PR submission! We just finished reviewing and merging it into the 4.17.0 release on October 10, 2022. When you get a chance, could you please Star the Liquibase project? The star button is in the upper right corner of the screen. |
Impact
Description
In certain cases the search path in a postgres database can be empty (not null, but an empty string). For us it happens when running postgres with testcontainers for IT tests, probably on rollbacks (as you call initializeDatabase for every rollback to reset default schema). In case searchPath is empty we should not try and process it, just re-set the default schema.