Skip to content

fix: exclude PostGIS system tables from RLS check#157

Open
adithyankoonoth wants to merge 2 commits into
supabase:mainfrom
adithyankoonoth:main
Open

fix: exclude PostGIS system tables from RLS check#157
adithyankoonoth wants to merge 2 commits into
supabase:mainfrom
adithyankoonoth:main

Conversation

@adithyankoonoth
Copy link
Copy Markdown

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

The security advisor flags public.spatial_ref_sys as a critical RLS
issue when the PostGIS extension is enabled. This is a false positive
because spatial_ref_sys is a PostGIS system table containing only
coordinate reference system definitions — no user data.

When users try to resolve it by running:
ALTER TABLE public.spatial_ref_sys ENABLE ROW LEVEL SECURITY

They get: ERROR: 42501: must be owner of table spatial_ref_sys

So the warning cannot be dismissed and users are left with a
permanent critical security alert they cannot fix.

Fixes #125

What is the new behavior?

Known PostGIS system tables (spatial_ref_sys, geometry_columns,
geography_columns, raster_columns, raster_overviews) are excluded
from the RLS check. Users with PostGIS enabled will no longer see
a false positive critical security warning for these tables.

Additional context

PostGIS creates these tables in the public schema by default and
does not support SET SCHEMA, so moving them to a different schema
is also not possible. Excluding them by name is the correct fix.

Referenced issue: #125

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.

Failed to toggle RLS: must be owner of table spatial_ref_sys

1 participant