Skip to content

Commit a71b371

Browse files
committed
chore: remove pgmq version constraint (#283)
# Remove PGMQ Version Constraint This PR removes the version constraint for the PGMQ extension in both the core schema and Supabase migrations. By removing the explicit version requirement (`version '1.4.4'`), we allow the database to use the latest available version of PGMQ. The changes affect: - `pkgs/core/schemas/0010_extensions.sql` - `pkgs/core/supabase/migrations/20250429164909_pgflow_initial.sql` - Updated the `atlas.sum` file to reflect these changes This approach provides more flexibility for PGMQ version management and avoids potential compatibility issues when newer versions are available.
1 parent 18f2d5c commit a71b371

File tree

5 files changed

+72
-13
lines changed

5 files changed

+72
-13
lines changed

.changeset/remove-pgmq-pin.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@pgflow/core': patch
3+
---
4+
5+
Fix installation failures on new Supabase projects by removing pgmq version pin.
6+
7+
Supabase upgraded to pgmq 1.5.1 in Postgres 17.6.1.016+ (https://github.com/supabase/postgres/pull/1668), but pgflow was pinned to 1.4.4, causing "extension has no installation script" errors on fresh instances.
8+
9+
Only affects new projects - existing installations are unaffected and require no action.
10+
11+
Thanks to @kallebysantos for reporting this issue!
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-- Extensions must be created first
2-
create extension if not exists pgmq version '1.4.4';
2+
create extension if not exists pgmq;

pkgs/core/supabase/migrations/20250429164909_pgflow_initial.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CREATE SCHEMA "pgflow";
33
-- Add new schema named "pgmq"
44
CREATE SCHEMA IF NOT EXISTS "pgmq";
55
-- Create extension "pgmq"
6-
CREATE EXTENSION IF NOT EXISTS "pgmq" WITH SCHEMA "pgmq" VERSION "1.4.4";
6+
CREATE EXTENSION IF NOT EXISTS "pgmq" WITH SCHEMA "pgmq";
77
-- Create "read_with_poll" function
88
CREATE FUNCTION "pgflow"."read_with_poll" ("queue_name" text, "vt" integer, "qty" integer, "max_poll_seconds" integer DEFAULT 5, "poll_interval_ms" integer DEFAULT 100, "conditional" jsonb DEFAULT '{}') RETURNS SETOF pgmq.message_record LANGUAGE plpgsql AS $$
99
DECLARE
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
h1:eDZ+F7VXqXxJeuJJTxxV6UTGnFGgvM/++AJVQc+Ao4Y=
2-
20250429164909_pgflow_initial.sql h1:5K7OqB/vj73TWJTQquUzn+i6H2wWduaW+Ir1an3QYmQ=
3-
20250517072017_pgflow_fix_poll_for_tasks_to_use_separate_statement_for_polling.sql h1:gnT6hYn43p5oIfr0HqoGlqX/4Si+uxMsCBtBa0/Z2Cg=
4-
20250609105135_pgflow_add_start_tasks_and_started_status.sql h1:9Yv/elMz9Nht9rCJOybx62eNrUyghsEMbMKeOJPUMVc=
5-
20250610180554_pgflow_add_set_vt_batch_and_use_it_in_start_tasks.sql h1:rqhO47GgL/M+Yq6vrNHB775wegnqs+snewqdtUs/E70=
6-
20250614124241_pgflow_add_realtime.sql h1:b461IlAMEyDrHCQ4JVN2RSbDOF0jdgCQCXe6qE1R3Rs=
7-
20250619195327_pgflow_fix_fail_task_missing_realtime_event.sql h1:vNSoTWGWOJmbgDmK8Ii067N8bGgKKvfzKZSoAhKysp8=
8-
20250627090700_pgflow_fix_function_search_paths.sql h1:NRMbmDKkOww7pOx1TVERMP5UdjmgfH0wE9QhzfBU3co=
9-
20250707210212_pgflow_add_opt_start_delay.sql h1:11J7SDgS6EVFUwxSi0bRZnNQgVGTV0EJGj9yuC0vczY=
10-
20250719205006_pgflow_worker_deprecation.sql h1:L3LDsVrUeABlRBXhHsu60bilfgDKEJHci5xWknH9XIg=
11-
20251006073122_pgflow_add_map_step_type.sql h1:CPYy9lf7qUlZrkLzDI/0nH3CSUZZqFwXC6pO84E7Ezg=
1+
h1:oxuMOlzSnTahsfKHxdx7pYYNr4aK+j2BppGkrO23TtM=
2+
20250429164909_pgflow_initial.sql h1:pPSR5ej8e7VUxSam0jUyUWQguMenrmsd9gS2dpi9QHM=
3+
20250517072017_pgflow_fix_poll_for_tasks_to_use_separate_statement_for_polling.sql h1:560T1AOw2XW+Hem7ZTt67Otl6PEdNwq4xFQVOnGY2Dk=
4+
20250609105135_pgflow_add_start_tasks_and_started_status.sql h1:7Ki2Jn9LhPAAGLs0ypwPfMn+9cPZ4ED9y23HWIa/O40=
5+
20250610180554_pgflow_add_set_vt_batch_and_use_it_in_start_tasks.sql h1:j63WQ4272fMlFe48rJVIpbLHuzu0cCfhd4Glbtm/eKw=
6+
20250614124241_pgflow_add_realtime.sql h1:yh6poH6mapmY/RZXkBzZFSv9ylFBtVdHcDd7kbR/Zdk=
7+
20250619195327_pgflow_fix_fail_task_missing_realtime_event.sql h1:DkCnr8aKycwBRB95ZGdQsP0yhfW+tTZcUROFgtDgE2I=
8+
20250627090700_pgflow_fix_function_search_paths.sql h1:0UQlJ7LF9PZ7Hje/r83XmWw66gDbfn4lg7ho9WT3wYM=
9+
20250707210212_pgflow_add_opt_start_delay.sql h1:hRR3baDRd0V41sVUq/l6z3fkAaNCSNLe8m0BvRIYpEU=
10+
20250719205006_pgflow_worker_deprecation.sql h1:VIJnWcNC2tbbc5UV9kAnQP5SNlr7N9LLEUSB3/KWoU4=
11+
20251006073122_pgflow_add_map_step_type.sql h1:glsi7ti7BWa7UwWZze8zDjlNZBNOv4+nPRKLYNRUOro=
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
draft: false
3+
title: 'pgflow 0.7.1: Fix pgmq 1.5.1 Version Conflict on New Supabase Projects'
4+
description: 'Fixes installation failures on new Supabase projects after pgmq upgrade'
5+
date: 2025-10-30
6+
authors:
7+
- jumski
8+
tags:
9+
- bugfix
10+
- supabase
11+
- pgmq
12+
featured: true
13+
---
14+
15+
import { Aside } from "@astrojs/starlight/components";
16+
17+
pgflow 0.7.1 fixes installation failures on fresh Supabase projects caused by pgmq version mismatch.
18+
19+
<Aside type="note" title="Existing Projects Unaffected">
20+
If you already have pgflow installed, you're completely unaffected. This fix only impacts fresh installations on new Supabase projects. No action needed, no code changes, and no need to update to 0.7.1.
21+
</Aside>
22+
23+
## The Bug
24+
25+
Installing pgflow on new Supabase projects failed with:
26+
27+
```
28+
ERROR: extension "pgmq" has no installation script nor update path for version "1.4.4" (SQLSTATE 22023)
29+
At statement: 2
30+
CREATE EXTENSION IF NOT EXISTS "pgmq" WITH SCHEMA "pgmq" VERSION "1.4.4"
31+
```
32+
33+
## Why It Happened
34+
35+
Supabase upgraded to pgmq 1.5.1 in Postgres 17.6.1.016+ ([supabase/postgres#1668](https://github.com/supabase/postgres/pull/1668)). pgflow's initial migration was pinned to version 1.4.4, which no longer exists in new Supabase instances.
36+
37+
## The Fix
38+
39+
Removed the version constraint from pgmq extension creation. pgflow now uses whatever pgmq version Supabase provides (1.4.4, 1.5.1, or newer).
40+
41+
```diff lang="sql"
42+
-CREATE EXTENSION IF NOT EXISTS "pgmq" WITH SCHEMA "pgmq" VERSION "1.4.4";
43+
+CREATE EXTENSION IF NOT EXISTS "pgmq" WITH SCHEMA "pgmq";
44+
```
45+
46+
## Credits
47+
48+
Thanks to [@kallebysantos](https://github.com/kallebysantos/) for reporting this issue!

0 commit comments

Comments
 (0)