Repository navigation
chore: set search path in migration - #2410
Conversation
imor
left a comment
There was a problem hiding this comment.
LGTM, graphql_public.graphql no longer set search_path to empty.
cb5ea9a to
88de835
Compare
Package version diff: none (aarch64-linux, x86_64-linux) |
PostgreSQL Extension Dependency Analysis: PR #2410
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 #2410
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 |
906ad7b to
231029d
Compare
|
lgtm, I rebased on top of develop and renamed |
|
You may not want to set an empty search path here. Take this scenario below. Basically a user can shadow an empty search path with relations created in pg_temp because pg_temp is searched first for relations (but not functions). This can be overridden by explicitly setting |
Great catch and thanks @AndrewJackson2020 🙏🏼 completely forgot about this nasty footgun with search_path. |
I'm using something like the below for this. Keep in mind this is only a security issue for security definer functions. For other functions this is arguably just a DX issue. I would ultimately like to find a linter that can catch stuff like this and maybe nudge us towards using schema qualified references. I opened an issue with plpgsql_check and the maintainer there seems to be game to implementing more checks around this. maybe Postgres-language-server could provide this as well. Was also thinking we should add this as a warning in splinter. |
A number of Supabase owned functions are created without a search_path. This breaks from best practice and can lead to unintended side-effects if the current_user search_path changes.