|
| 1 | +--- |
| 2 | +draft: false |
| 3 | +title: 'pgflow 0.8.0: Modernizing Dependencies - pgmq 1.5.0 and PostgreSQL 17' |
| 4 | +description: 'Breaking changes requiring pgmq 1.5.0 or higher and PostgreSQL 17, with built-in migration safety checks' |
| 5 | +date: 2025-11-18 |
| 6 | +authors: |
| 7 | + - jumski |
| 8 | +tags: |
| 9 | + - release |
| 10 | + - breaking-change |
| 11 | + - migration |
| 12 | +featured: true |
| 13 | +cover: |
| 14 | + alt: 'Cyberpunk hacker upgrading database dependencies on a glitchy terminal screen' |
| 15 | + image: '../../../assets/cover-images/pgflow-0-8-0-modernizing-dependencies-pgmq-1-5-0-and-postgresql-17.png' |
| 16 | +--- |
| 17 | + |
| 18 | +import { Aside } from "@astrojs/starlight/components"; |
| 19 | + |
| 20 | +pgflow 0.8.0 requires pgmq 1.5.0 or higher and PostgreSQL 17. This release removes the pgmq compatibility layer and prepares the foundation for upcoming flow auto-compilation features. |
| 21 | + |
| 22 | +<Aside type="caution" title="Breaking Change"> |
| 23 | + This version will NOT work with pgmq 1.4.x or earlier. The migration includes a compatibility check that will abort with a clear error message if pgmq 1.5.0 is not detected. |
| 24 | +</Aside> |
| 25 | + |
| 26 | +## What's Changing |
| 27 | + |
| 28 | +pgflow 0.8.0 introduces breaking dependency changes: |
| 29 | + |
| 30 | +1. **pgmq version**: Now requires 1.5.0 or higher (previously supported 1.4.x) |
| 31 | +2. **PostgreSQL version**: Upgrades to PostgreSQL 17 (from 15) |
| 32 | +3. **Supabase CLI**: Requires version 2.34.3 or higher (includes pgmq 1.5.0+) |
| 33 | + |
| 34 | +The migration will fail safely if these requirements are not met - no partial upgrades or corrupted state. |
| 35 | + |
| 36 | +## Background |
| 37 | + |
| 38 | +This release skips backward compatibility entirely - pgflow 0.8.0 requires pgmq 1.5.0 from the start. Maintaining compatibility layers for older versions would accumulate technical debt that becomes harder to remove as the project matures. |
| 39 | + |
| 40 | +Additionally, upcoming features like flow auto-compilation depend on infrastructure available only in newer Supabase versions (automatic edge function respawning in local development). Moving to pgmq 1.5.0 and PostgreSQL 17 unblocks these improvements. |
| 41 | + |
| 42 | +## Before You Upgrade |
| 43 | + |
| 44 | +### Check Your pgmq Version |
| 45 | + |
| 46 | +Run this query to verify your current pgmq version: |
| 47 | + |
| 48 | +```sql |
| 49 | +SELECT extversion FROM pg_extension WHERE extname = 'pgmq'; |
| 50 | +``` |
| 51 | + |
| 52 | +You need version 1.5.0 or higher to upgrade to pgflow 0.8.0. |
| 53 | + |
| 54 | +### Compatibility Check Built-In |
| 55 | + |
| 56 | +The migration includes a pre-check that inspects the pgmq schema before making any changes. If pgmq 1.5.0 is not detected, the migration aborts with this error: |
| 57 | + |
| 58 | +``` |
| 59 | +ERROR: INCOMPATIBLE PGMQ VERSION DETECTED |
| 60 | +
|
| 61 | +This migration requires pgmq 1.5.0 or higher. |
| 62 | +The pgmq.message_record type is missing the "headers" column, |
| 63 | +which indicates you are running pgmq < 1.5.0. |
| 64 | +
|
| 65 | +Action required: |
| 66 | + - Supabase: Ensure you are running a recent version that includes pgmq 1.5.0+ |
| 67 | + - Self-hosted: Upgrade pgmq to version 1.5.0 or higher before running this migration |
| 68 | +
|
| 69 | +Migration aborted to prevent runtime failures. |
| 70 | +``` |
| 71 | + |
| 72 | +This safety check prevents partial migrations and data corruption. |
| 73 | + |
| 74 | +## Migration Guide |
| 75 | + |
| 76 | +### Supabase Cloud Users |
| 77 | + |
| 78 | +Supabase CLI version 2.34.3 or higher includes pgmq 1.5.0 by default. To upgrade: |
| 79 | + |
| 80 | +1. Update your Supabase CLI if needed: |
| 81 | + ```bash |
| 82 | + supabase -v # Check current version |
| 83 | + npm install -g supabase # Update if below 2.34.3 |
| 84 | + ``` |
| 85 | +2. Verify your pgmq version using the SQL query above |
| 86 | +3. If you have pgmq 1.5.0+, run your migrations normally: |
| 87 | + ```bash |
| 88 | + supabase db push |
| 89 | + ``` |
| 90 | +4. If you have pgmq 1.4.x, wait for your Supabase instance to upgrade before updating pgflow |
| 91 | + |
| 92 | +### Self-Hosted Users |
| 93 | + |
| 94 | +You must upgrade pgmq to 1.5.0+ before upgrading pgflow: |
| 95 | + |
| 96 | +1. Check your current pgmq version |
| 97 | +2. Upgrade pgmq to 1.5.0 or higher following the [pgmq upgrade guide](https://github.com/tembo-io/pgmq) |
| 98 | +3. Upgrade PostgreSQL to version 17 if not already running it |
| 99 | +4. Run your pgflow migrations: |
| 100 | + ```bash |
| 101 | + supabase db push |
| 102 | + ``` |
| 103 | + |
| 104 | +## What If I Can't Upgrade? |
| 105 | + |
| 106 | +If you cannot upgrade to pgmq 1.5.0 immediately, stay on pgflow 0.7.x. The migration safety check ensures you cannot accidentally upgrade to an incompatible version. |
| 107 | + |
| 108 | +Your existing pgflow 0.7.x installation will continue working until you are ready to upgrade your infrastructure. |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +For questions or issues with the upgrade, visit the [pgflow Discord](https://www.pgflow.dev/discord/) or [open a GitHub issue](https://github.com/pgflow-dev/pgflow/issues). |
0 commit comments