Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/pgmq-queue-trigger-fallback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@supabase/pg-delta": patch
---

fix(pg-delta): suppress user triggers on pgmq queue/archive tables in supabase integration

Follow-up to the Wasm FDW dependents fix. `pgmq.q_<name>` and `pgmq.a_<name>` are materialized lazily by `select pgmq.create('<name>')`, not by `CREATE EXTENSION pgmq`. The trigger extractor already drops these via the `pg_depend deptype='e'` row that pgmq records, but real-world cloud projects can lose that row (older pgmq versions — pgmq `1.4.4` which Supabase Cloud currently ships never records it — manual `pg_dump`/restore that strips extension deps, etc.), so `supabase db reset` aborts at the trigger statement with `relation "pgmq.q_<name>" does not exist`. Add a defensive name-match fallback in the supabase integration filter so the trigger is dropped even when the principled signal is missing.
9 changes: 9 additions & 0 deletions .changeset/wasm-fdw-dependents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@supabase/pg-delta": patch
---

fix(pg-delta): suppress Wasm FDW servers, foreign tables, and user mappings in supabase integration

Follow-up to CLI-1470. Also suppress SERVER (object/comment/security-label scopes), FOREIGN TABLE, and USER MAPPING changes whose parent wrapper is a Supabase Wasm FDW — identified by the `extensions.wasm_fdw_handler` / `extensions.wasm_fdw_validator` functions the `wrappers` extension ships — so `db pull` no longer emits `CREATE SERVER clerk_oauth_server` for platform Wasm FDWs that local Docker cannot provision.

The discriminator is the Wasm handler/validator function names, not the bare `extensions.*` namespace: contrib FDWs like `postgres_fdw` install their handler/validator into `extensions` on Supabase too, but they ARE available in the local image, so user-created `postgres_fdw` wrappers (and their servers, foreign tables, and user mappings) must still roundtrip. Server _privilege_ scope is likewise preserved — `GRANT/REVOKE ON SERVER` does not require superuser.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,10 @@ docs/api-reference/
# ===================
# tldr ignore patterns
# ===================
.tldr/
.tldr/

# Verdaccio local registry state (created by `bun run verdaccio:start`)
.verdaccio/storage/
.verdaccio/htpasswd
.verdaccio/plugins/
verdaccio/.verdaccio/
691 changes: 612 additions & 79 deletions bun.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"docs:pg-delta": "bun run --filter '@supabase/pg-delta' docs",
"test:pg-delta": "bun run --filter '@supabase/pg-delta' test",
"test:pg-topo": "bun run --filter '@supabase/pg-topo' test",
"verdaccio:start": "verdaccio --config ./verdaccio/config.yaml",
"pg-delta:publish-local": "bun scripts/verdaccio-publish-pg-delta.ts",
"version": "changeset version"
},
"devDependencies": {
Expand All @@ -23,7 +25,8 @@
"nyc": "^18.0.0",
"oxfmt": "0.51.0",
"oxlint": "1.66.0",
"oxlint-tsgolint": "0.23.0"
"oxlint-tsgolint": "0.23.0",
"verdaccio": "^6.0.5"
},
"overrides": {
"cpu-features": "file:./.stubs/cpu-features"
Expand Down
6 changes: 6 additions & 0 deletions packages/pg-delta/src/core/catalog.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ function normalizeCatalog(catalog: Catalog): Catalog {
options: redactSensitiveOptionPairs(server.options),
comment: server.comment,
privileges: server.privileges,
wrapper_handler: server.wrapper_handler,
wrapper_validator: server.wrapper_validator,
});
});

Expand All @@ -457,6 +459,8 @@ function normalizeCatalog(catalog: Catalog): Catalog {
user: mapping.user,
server: mapping.server,
options: redactSensitiveOptionPairs(mapping.options),
wrapper_handler: mapping.wrapper_handler,
wrapper_validator: mapping.wrapper_validator,
});
});

Expand All @@ -472,6 +476,8 @@ function normalizeCatalog(catalog: Catalog): Catalog {
options: redactSensitiveOptionPairs(foreignTable.options),
comment: foreignTable.comment,
privileges: foreignTable.privileges,
wrapper_handler: foreignTable.wrapper_handler,
wrapper_validator: foreignTable.wrapper_validator,
}),
);

Expand Down
Loading
Loading