psql session. It connects through the same pooler URL the Connect modal shows, so the same transaction-mode constraints apply.
For the conceptual model behind direct SQL, see Direct Postgres patterns. For migrations specifically, see Migrations.
Where it is
In the Studio, under your project: SQL Editor in the left sidebar. You’ll see a query pane, a results pane, and a list of saved snippets.What it’s good for
- One-off queries during development — “what rows does this query return?”, “did my migration actually apply?”
- Inspecting schema —
\ddoesn’t work butSELECT * FROM information_schema.tables WHERE table_schema = 'public'does. - Manual data fixes — patching a few rows after a migration bug, removing test data.
- Testing RLS policies before deploying — combine with the
SET LOCAL ROLEpattern from RLS Testing to simulate a specific role. - Saved snippets — frequently-used queries (usage reports, debugging selectors) tucked into the sidebar so you don’t retype them.
What it’s not for
- Long-running migrations. The editor times out at the pooler-level statement timeout (30 seconds on the
authenticatorrole; higher assupabase_adminbut still bounded). For long migrations, use a.sqlfile +psqlfrom your laptop or CI. - Production hot-fix workflow. Running ad-hoc SQL in production is what mistakes are made of. Use it for inspection; gate writes behind your normal migration flow.
- Application traffic. This is a Studio-internal tool, not an HTTP API. Don’t try to drive it programmatically — it has no documented endpoint contract.
The role you run as
The SQL Editor runs queries as the project’spostgres superuser by default, which means RLS is bypassed for editor queries. This is why “I tested it in the SQL editor and it worked, but my app gets denied” is a common confusing moment — your app connects as anon or authenticated, and RLS applies there.
To test as anon or authenticated, wrap your test in a transaction and SET LOCAL ROLE:
ROLLBACK undoes the SET LOCAL changes. The pattern is the same as the RLS Testing recipes; the editor is just a different surface for running them.
Snippets
Click “New snippet” (or save the current query) and the Studio persists it under your account. Snippets are scoped per user — your team won’t see them unless you share the snippet URL. A few snippets worth saving for any project:Next steps
Direct Postgres patterns
psql equivalents for everything the editor does, plus things it can’t.
RLS Testing
The SET LOCAL ROLE pattern in detail.
Schemas concept
The five schemas you’ll see in pg_namespace and what each contains.
Migrations
Move from one-off editor queries to versioned migrations.