Repository navigation
refactor: set explicit search paths for functions - #338
AndrewJackson2020 wants to merge 1 commit into
Conversation
17438da to
9565a28
Compare
9565a28 to
fa0d66f
Compare
| returns net.http_response_result | ||
| volatile | ||
| language plpgsql | ||
| SET search_path = pg_catalog, pg_temp |
There was a problem hiding this comment.
We have already shipped v0.20.5 tag.
IMO this file should be renamed to sql/pg_net--0.20.5--0.20.6.sql.
We may also create sql/pg_net--0.20.4--0.20.5.sql that only contains comments.
There was a problem hiding this comment.
IMO we should stick with what in tree/contrib extensions do in postgres, ie don't provide extension upgrade scripts unless there were changes in the SQL objects that get installed in the database.
I get the perceived benefits of this: it's easier to identify what version you are working with. In reality I think that this makes things more confusing though. To me what makes the most sense is acknowledging that the version can drift between schema and .so and if we want to make it more clear in pg_net we should expose the version number of the .so as a read only GUC like we do in supautils.
Edit: went ahead and raised a PR here to expose version number as a GUC #339.
This PR sets explicit search paths for every function in the pg_net codebase. It also bumps the version of plpgsql_check to an unreleased version that incorporates the extra_security_warnings_level parameter which enables more stringent checks. I do not want to merge this until plpgsql_check gets a full release so I'm keeping this drafted for now. Also I intend to bump the
extra_security_warnings_levelto 4 in later PR's but will keep it at 1 for this PR as it caught a bunch of recommended changes.