fix(pgmq): resolve drop_queue overloading bug - #2400
Open
mandar1045 wants to merge 2 commits into
Open
Conversation
Fixes supabase#1867 When pgmq was updated to 1.5.1, the drop_queue function introduced overloading (adding a partitioned parameter). The static drop commands in the after-create.sql script failed with 'function is not unique', breaking local db resets for new projects. This replaces the static drops with a dynamic loop over pg_proc to safely drop all overloaded signatures, and updates the patched function signature to align with 1.5.1 API while maintaining backwards compatibility.
mandar1045
force-pushed
the
fix/pgmq-drop-queue-overload
branch
from
September 2, 2026 19:07
5cffa24 to
84e8d45
Compare
Author
|
Pushed an update: the detachment loop now explicitly checks |
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
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.
TL;DR
Fixes an issue where "pgmq" extension setup fails on PostgreSQL 17.6+ because "pgmq.drop_queue" has multiple versions.
Problem
Running "npx supabase db reset" fails when creating the "pgmq" extension.
This happens because PostgreSQL 17.6+ can have multiple "pgmq.drop_queue" functions, but the setup script only tries to remove one of them.
Solution
Updated the setup script to find and remove all versions of "pgmq.drop_queue" before creating the extension.
Also added a check to make sure we only remove functions that are actually registered with the extension.
Updated the function signature to match pgmq 1.5.1.
Testing
Tested with PostgreSQL 17.6.1.
The script now runs successfully without the duplicate-function error.
Ref