Skip to content

fix: retrieve tables in non-public schemas by ID#1053

Merged
avallete merged 2 commits into
supabase:masterfrom
oniani1:fix/tables-retrieve-non-public-schema
Mar 30, 2026
Merged

fix: retrieve tables in non-public schemas by ID#1053
avallete merged 2 commits into
supabase:masterfrom
oniani1:fix/tables-retrieve-non-public-schema

Conversation

@oniani1
Copy link
Copy Markdown
Contributor

@oniani1 oniani1 commented Mar 23, 2026

Fixes #1017

retrieve({ id }) defaults schema to 'public' and passes a schemaFilter to the query even when looking up by OID. Since OIDs are globally unique across all schemas, the filter is unnecessary and causes 404s for tables in non-public schemas.

This also affects update() and remove() since they call retrieve({ id }) internally.

Fix: Skip the schemaFilter in the id branch of retrieve().

Test: Added a test that creates a table in a non-public schema and retrieves it by ID.

The retrieve method defaults schema to 'public' and applies a schema
filter even when looking up by OID. Since OIDs are globally unique,
the schema filter is unnecessary and causes 404s for tables in
non-public schemas. This also affects update and remove since they
call retrieve internally.

Fixes supabase#1017
@oniani1 oniani1 requested review from a team, avallete and soedirgo as code owners March 23, 2026 19:50
Copy link
Copy Markdown
Member

@avallete avallete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there ! This looks good to me thanks for the catch.

Comment thread test/lib/tables.ts Outdated
@avallete avallete self-requested a review March 30, 2026 08:54
@avallete avallete merged commit 199e6d0 into supabase:master Mar 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] GET /tables/:id returns 404 for tables in non-public schemas (v0.91.0+)

2 participants