Prevent spurious SET SEARCH_PATH SQL statements for Postgres during update-sql command. Fixes #5316 #5774
+9
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Impact
Description
Prevent resetting the search path in Postgres after a rollback if we are running in a mode that does not update the database to avoid spurious SET SEARCH_PATH SQL statements.
The logic in
DatabaseUtils.initializeDatabase
for Postgres expects changes to the SEARCH_PATH to be persisted to detect when the SEARCH_PATH is already correct(ed). However inupdate-sql
mode these changes are not executed, causing the detection mechanism to fail and resulting in extra SET SEARCH_PATH statements.Things to be aware of
I'm aware of the other change in review that will fix this issue, but that is a bigger change and might take a long time to be merged. This could be a quick win.
Things to worry about
Additional Context