splinter icon indicating copy to clipboard operation
splinter copied to clipboard

Failed to toggle RLS: must be owner of table spatial_ref_sys

Open Vedsaga opened this issue 6 months ago • 3 comments

Bug report

  • [x] I confirm this is a bug with Supabase, not with my own application.
  • [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Linter suggesting to apply the RLS on table public.spatial_ref_sys. But, we can't do that, attaching the error Failed to toggle RLS: must be owner of table spatial_ref_sys

Screenshots

Image

Image

Vedsaga avatar Jun 28 '25 11:06 Vedsaga

spatial_ref_sys comes from the PostGIS so the best solution here would be to drop and recreate that extension inside a dedicated schema. PostGIS comes with lots of sql entities so i'd recommend making a separate "gis" schema for it

olirice avatar Jun 30 '25 19:06 olirice

Does that mean Linter only analyze the public schema ?

Vedsaga avatar Jul 01 '25 03:07 Vedsaga

The linter only confirms that RLS is enabled for tables that are exposed over your APIs. By default, that's the public schema. If you update your API settings to include additional schemas, those would be scanned as well. You can see the implementation of that logic here https://github.com/supabase/splinter/blob/82f1f09f8ee8786e6be060b255d3c3dbaf4f37a9/lints/0013_rls_disabled_in_public.sql#L38

olirice avatar Jul 01 '25 14:07 olirice