Repository navigation
Conversation
β¦supabase_vault)
isotope-complete.sql was regenerated from the hosted Supabase project, which now
runs PostgreSQL 17. The dump therefore carried two constructs that stock
PostgreSQL 16 β the version pinned by the schema-lint CI shim and used by fresh
self-hosted installs β cannot execute:
* CREATE EXTENSION "supabase_vault" β a Supabase-managed extension that does
not exist on stock Postgres of any version. Nothing in the schema references
vault.* objects.
* 126x GRANT MAINTAIN ON TABLE ... β MAINTAIN is a Postgres 17 privilege;
PG16 rejects it with "unrecognized privilege type". It is an artifact of
Supabase's default GRANT-ALL bundle and is meaningless for the anon /
authenticated / service_role API roles (RLS governs access).
Under `psql -v ON_ERROR_STOP=1` the schema aborted at the first of these, so the
"Test isotope-complete.sql against PostgreSQL" step exited non-zero and turned
the whole SQL Schema Validation workflow red.
Fix at the root (the generator) and reproduce its corrected output in the
committed dump:
* scripts/schema-dump.mjs: skip Supabase-managed platform extensions and drop
the MAINTAIN privilege, so a future regeneration from the PG17 project stays
installable on PG16+.
* isotope-complete.sql: remove the supabase_vault CREATE EXTENSION line and the
126 GRANT MAINTAIN lines (127 lines removed).
* .github/workflows/schema-lint.yml: add supabase_vault to the cloud-only strip
list as a defensive safety net, matching the existing supabase_admin/pg_net
entries.
Verified against a local PostgreSQL 16 instance with the same Supabase auth/
storage shim CI uses: the schema now executes with exit code 0 and zero errors
(44 public tables, 153 RLS policies, 122 functions). ci.yml gates (server smoke,
docs, dollar-quotes, supabase tooling) still pass.
Co-authored-by: Suydev <elixir.suyashprabhu@gmail.com>
β Deploy Preview for merry-starship-529305 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Contributor
|
π This PR hasn't had any activity for 14 days. It will be automatically closed in 7 days unless there's a review, commit, or comment.
|
Contributor
|
π This PR was automatically closed due to inactivity. Feel free to reopen it when you're ready to continue! |
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.
What was broken
The SQL Schema Validation (
schema-lint) workflow was red onmain.isotope-complete.sqlhad been regenerated from the hosted Supabase project, which now runs PostgreSQL 17, so the dump carried two constructs that stock PostgreSQL 16 β the version pinned by the CI shim and used by fresh self-hosted installs β cannot execute:CREATE EXTENSION "supabase_vault"β a Supabase-managed extension absent from stock Postgres of any version (extension "supabase_vault" is not available). Nothing in the schema referencesvault.*.GRANT MAINTAIN ON TABLE ...βMAINTAINis a PostgreSQL 17 privilege; PG16 rejects it withunrecognized privilege type "maintain". It's an artifact of Supabase's defaultGRANT ALLbundle and is meaningless for theanon/authenticated/service_roleAPI roles (RLS governs access).Under
psql -v ON_ERROR_STOP=1the schema aborted at the first of these (exit code 3), so theTest isotope-complete.sql against PostgreSQLstep turned the workflow red.The fix
Fix at the root (the generator) and reproduce its corrected output in the committed dump:
scripts/schema-dump.mjsβ skip Supabase-managed platform extensions, and drop theMAINTAINprivilege from the table-grants query, so a future regeneration from the PG17 project stays installable on PG16+.isotope-complete.sqlβ remove thesupabase_vaultCREATE EXTENSIONline and the 126GRANT MAINTAINlines (127 lines deleted). Table/policy/function counts unchanged..github/workflows/schema-lint.ymlβ addsupabase_vaultto the cloud-only strip list as a defensive safety net (matches the existingsupabase_admin/pg_netentries).Verification
Validated on a local PostgreSQL 16 instance using the same Supabase auth/storage/role shim CI uses:
psqlexit3(aborts atsupabase_vault; next errorGRANT MAINTAIN).psqlexit0, zero errors β 44 public tables, 153 RLS policies, 122 functions.ci.ymlgates that touch changed files (server smoke boot,validate-docs,check-dollar-quotes, Supabase tooling parse) still pass;schema-dump.mjspassesnode --check.Explainer doc
π Explainer β Fixing schema-lint CI (PG17 dump vs PG16 shim)
Notes / follow-ups (out of scope)
The migration-file steps in
schema-lint.ymlcount errors withgrep -c '^ERROR', which never matchespsql'spsql:file:line: ERROR:output β so those steps can't currently turn red (a pre-existinghypopgerror insql/isotope-schema-restore.sqlis masked by this). Left untouched here to avoid introducing new failures; flagged for a separate PR.Co-authored-by: Suydev elixir.suyashprabhu@gmail.com