Replies: 2 comments
|
Postgis is supposed to be installed in the extensions schema. That is the default dashboard setting. |
|
Gary's right, and Supabase's PostGIS guide covers this exact case (troubleshooting). It says The guide gives two ways to move it (steps):
Either way, PostGIS ends up in |
Uh oh!
There was an error while loading. Please reload this page.
On my project, the anon role can write to public.spatial_ref_sys through the REST API: a PATCH rewriting an existing row with its own value returns 200, and a DELETE returns 200. The grants come from supabase_admin, the table owner (created by the PostGIS extension). As a result, REVOKE ... FROM anon, authenticated run as postgres succeeds silently but changes nothing. Enabling RLS fails with "must be owner", and moving PostGIS to the extensions schema fails with "must be owner of extension".
The anon key ships in a public mobile app, so anyone could alter or delete the SRID reference table. Could a Supabase admin run the following on my project? I have already opened a support ticket (Free plan) and can share its number.
REVOKE INSERT, UPDATE, DELETE, TRUNCATE ON public.spatial_ref_sys FROM anon, authenticated;
Better still, could this be applied by default to PostGIS projects? Related: issue #47206, discussions #26302 and #19143. Thanks.
All reactions