Conversation
…default, loadable by postgres
PostgreSQL Extension Dependency Analysis: PR #2105
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesPostgreSQL 17 Extension DependenciesOrioleDB 17 Extension Dependencies |
PostgreSQL Package Dependency Analysis: PR #2105
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
Just to summarize, |
There was a problem hiding this comment.
From a quick manual test it seems safeupdate has been working well for Data API/PostgREST, anon and authenticated have it enabled. This is thanks to authenticator having it in session_preload_libraries.
I added some feedback mentioning it's unnecessary and in fact a no-op adding local_preload_libraries to anon, authenticated.
Now, I should ask if the motivation of this PR is to have the postgres role able to use the safeupdate so other pg clients can benefit? Edit: Re-reading the original issue #1308, indeed looks this was the main motivation.
If so, we should focus on modifying the postgres role and keep the authenticator settings as is.
@steve-chavez Can you provide your test case please? Running this on |
|
@encima No, it won't work like that. postgres/migrations/db/init-scripts/00000000000000-initial-schema.sql Lines 29 to 31 in e157099 The only role that has So in SQL if you LOGIN as I only tested this through PostgREST (I don't think the $ curl -X PATCH 'https://<url>.supabase.co/rest/v1/items?select=id' -H "apikey: <redacted>" -H "Content-Type: application/json"
--data @- <<JSON
{"name": "asdf"}
JSON
{"code":"21000","details":null,"hint":null,"message":"UPDATE requires a WHERE clause"}$
$ curl -X DELETE 'https://<url>.supabase.co/rest/v1/items?select=id' -H "apikey: <redacted>" -H "Content-Type: application/json
" --data @- <<JSON
{"name": "asdf"}
JSON
{"code":"21000","details":null,"hint":null,"message":"DELETE requires a WHERE clause"}$ |
Got it, thanks. OK, so the aim of the PR is only to fix postgres not using safeupdate. If that's the case, we don't need to do any breaking changes and can just merge after I modify. |
|
Correct, it should be a pure addition without breaking changes. |
|
Maybe a new PR called |
Renamed this PR to match that. 🙏 |
b6ae15e to
4fd6386
Compare
Co-authored-by: Steve Chavez <stevechavezast@gmail.com>

What kind of change does this PR introduce?
Fix and feature
What is the current behavior?
Safeupdate enabled for authenticator, not loadable/usable by other roles
What is the new behavior?
Load safeupdate as a plugin so it can be loaded by any role (not just superuser)
load $libdir/plugins/safeupdateLoaded by default for anon, authenticator, authenticated and postgres.
Enabled by default for anon, authenticator and authenticated
Additional context
Supersedes #2027
session_preload_librariesis reset for authenticator role and safeupdate is only built into thepluginsdir, not into the extension dir additionally