For end users
I'm getting errors running the migration SQL in Supabase. What do I do?
FAQ /InstallStep 6 has Claude write a SQL file in your install folder (each attempt gets a unique timestamped name like run-2026-05-03T15-04-22Z.sql, so old attempts stay around for reference). You paste that file’s contents into Supabase’s SQL Editor and click Run. A few specific things go wrong; here’s how to find the editor and how to fix the most common errors.
Where the SQL Editor lives
Open your Supabase project in the dashboard. Look at the left sidebar. The SQL Editor icon usually looks like a small >_ terminal symbol; on some accounts it’s labelled “SQL Editor” plainly. Click it. Once inside, click New query in the top right to open a fresh editor pane.
If you can’t find it in the sidebar, try Database → SQL Editor from the top-level navigation; some Supabase plans group it there.
Clear the editor before pasting
This is the one that catches almost everyone. The SQL Editor often pre-fills with example queries, or it remembers your last query from earlier. Before you paste, select everything in the editor and delete it.
- Mac: Cmd-A to select all, then Delete.
- Windows / Linux: Ctrl-A to select all, then Delete.
Now the editor is empty. Open the SQL file Claude just wrote in your install folder, copy its full contents, paste into the editor. Click Run.
If you skip this step and paste underneath the existing code, Postgres tries to run both blocks. You get a syntax error, or worse, the leftover query runs first and the migration partially applies on top of broken state.
Common errors and what they mean
”syntax error at or near …”
Almost always means the editor wasn’t cleared. Select all, delete, paste again, run.
”extension uuid-ossp does not exist” or “extension pgcrypto does not exist”
Pectus’s schema needs two Postgres extensions that Supabase usually enables by default. If yours doesn’t have them, paste this into a new SQL Editor query, click Run, then re-run the migration file:
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
“relation X already exists”
A previous run committed some tables before erroring out. Two options:
- Start the database over (fastest if you haven’t put any data in yet). In a new SQL Editor query, run:
This wipes everything in the database. Then have Claude write a fresh migration file (it’ll get a new timestamp) and paste it in.DROP SCHEMA public CASCADE; CREATE SCHEMA public; - Tell Claude. Paste the exact error back at your install agent. Claude will read which migration partially ran, look at the older timestamped file in your install folder, and walk you through the surgical fix.
”permission denied for schema public”
You’re running it through the wrong path. The SQL Editor in the dashboard runs queries as the project superuser, which is what the migration needs. If you somehow ended up running the file from a script using the anon key, switch to the SQL Editor in the dashboard and run it from there.
If it half-ran and you’re stuck
Don’t guess. Paste the exact error message back at your install agent. Claude can read the error, look at the migration files in your install folder (which include the latest attempt and any earlier ones), and tell you the one or two lines you need to run to recover.