Skip to content

refactor: set explicit search paths for functions - #338

Open
AndrewJackson2020 wants to merge 1 commit into
masterfrom
extra_security_warnings
Open

AndrewJackson2020 wants to merge 1 commit into
masterfrom
extra_security_warnings

Conversation

@AndrewJackson2020

Copy link
Copy Markdown
Contributor

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_level to 4 in later PR's but will keep it at 1 for this PR as it caught a bunch of recommended changes.

@AndrewJackson2020
AndrewJackson2020 force-pushed the extra_security_warnings branch 3 times, most recently from 17438da to 9565a28 Compare November 18, 2026 04:27
@AndrewJackson2020
AndrewJackson2020 marked this pull request as ready for review November 18, 2026 14:28
@AndrewJackson2020
AndrewJackson2020 requested a review from a team as a code owner November 18, 2026 14:28

@hanefi hanefi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall.

returns net.http_response_result
volatile
language plpgsql
SET search_path = pg_catalog, pg_temp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@AndrewJackson2020 AndrewJackson2020 Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 branch has not been deployed

No deployments
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.

2 participants