-
-
Notifications
You must be signed in to change notification settings - Fork 218
fix(pgmq): replace drop_queue function if exists #1828
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21f9421 to
8a0ed1b
Compare
8a0ed1b to
37fac6b
Compare
37fac6b to
df6d946
Compare
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 of `CREATE FUNCTION` for `pgmq.drop_queue(TEXT)` in the upgrade script from 1.4.5 to 1.5.0.
…cript We create a new custom nixos test for the pgmq extension to test that the extension works well with the after-create.sql script present in `ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql`.
df6d946 to
cb01cd2
Compare
samrose
approved these changes
Oct 9, 2025
Collaborator
samrose
left a comment
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.
passes all tests on relevant branches
hunleyd
added a commit
that referenced
this pull request
Oct 14, 2025
* origin/develop: fix(nix): remove '%' character from Nix trusted-public-keys configuration (#1840) chore: systemd hardening (#1837) Revert "refactor(postgresq): switch to 'include_dir' and then rename conf files to ensure ordering" (#1835) refactor(ansible): bring our ansible up to modern ansible-lint standards (#1821) fix(pgmq): replace drop_queue function if exists (#1828) refactor(postgresq): switch to 'include_dir' and then renames conf files to ensure ordering (#1820) feat: support multiple versions of the pg_jsonschema extension (#1757) feat: bump auth to v2.180.0 (#1829) feat: update supautils confs w/ new tables feat(migrations): predefined role grants (#1815) feat: run pg_regress tests after installing the last version of the extension (#1826) fix(pgmq): add missing helper function in migration script (#1825) feat: support multiple versions of the pgmq extension (#1668) feat: run pg_regress during extension tests (#1812) feat: support multiple versions of the pgrouting extension (#1687) refactor(ansible): bring our ansible up to modern ansible-lint standards (#1819) feat: support multiple versions of the pg-graphql extension (#1761)
encima
pushed a commit
that referenced
this pull request
Oct 28, 2025
* fix(pgmq): replace drop_queue function if exists 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 of `CREATE FUNCTION` for `pgmq.drop_queue(TEXT)` in the upgrade script from 1.4.5 to 1.5.0. * feat: test that the pgmq extension works well with the after create script We create a new custom nixos test for the pgmq extension to test that the extension works well with the after-create.sql script present in `ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql`. * chore: bump versions to release post-rebase --------- Co-authored-by: Sam Rose <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 FUNCTIONinstead ofCREATE FUNCTIONforpgmq.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.