-
Notifications
You must be signed in to change notification settings - Fork 379
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When resetting a Supabase preview branch, PGMQ queue creation fails with a sequence-related error. The pgmq.create() call for a queue (e.g., my_queue) references a sequence (pgmq.q_my_queue_msg_id_seq) that doesn't exist, causing the migration to fail.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a preview branch with migrations that create PGMQ queues:
CREATE EXTENSION IF NOT EXISTS pgmq;
SELECT pgmq.create('my_queue');
SELECT pgmq.create('my_queue_dlq');- Let the branch build successfully (first build works).
- Reset the preview branch via the Supabase dashboard.
- Go to the manage preview branches page -> https://supabase.com/dashboard/project/{your-project-id}/branches
- Click on 'Reset branch' under the menu on the right of your branch name
- The branch rebuilds and the migration fails.
- View the logs of the latest build
- See error
Expected behavior
- Queues should be created successfully on branch reset.
- PGMQ extension state should be consistent after reset.
- No sequence-related errors should occur.
Actual behavior
- Migration fails with:
ERROR: relation "pgmq.q_my_queue_msg_id_seq" does not exist (SQLSTATE 42P01)
At statement: 786
SELECT pgmq.create('my_queue_dlq')- The first queue (my_queue) may be created, but the second queue (my_queue_dlq) fails.
- This only occurs on branch reset, not on first build or new commits.
System information
- Supabase: Preview branch reset functionality
- PGMQ extension: Latest version (via CREATE EXTENSION IF NOT EXISTS pgmq)
- Migration file: Baseline migration or any migration creating PGMQ queues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working