fix(pgmq): replace drop_queue function if exists #1828
Merged
+206
−6
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.
We introduced a patch to override pgmq.drop_queue(TEXT) to conditionally drop objects only if they are part of the extension in
ansible/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql
. This script might have been installed on installations with existing 1.4.4 extensions.When the user tries to upgrade pgmq from 1.4.4 to 1.5.1, the upgrade process will fail because the upgrade script doesn't expect
pgmq.drop_queue(TEXT)
to exist.This change introduce the a patch to the pgmq extension to use
CREATE OR REPLACE FUNCTION
instead ofCREATE FUNCTION
forpgmq.drop_queue(TEXT)
in the upgrade script from 1.4.5 to 1.5.0.We also test that the install/upgrade of the extension works well with our after create script.