Converting contrib SQL functions to new style
Tom Lane <tgl@sss.pgh.pa.us>
Attachments
- 0001-citext-sql-functions.patch (text/x-diff) patch 0001
- 0002-earthdistance-sql-functions.patch (text/x-diff) patch 0002
- 0003-pageinspect-sql-functions.patch (text/x-diff) patch 0003
- 0004-pg_freespacemap-sql-functions.patch (text/x-diff) patch 0004
- 0005-xml2-sql-functions.patch (text/x-diff) patch 0005
Attached are some draft patches to convert almost all of the contrib modules' SQL functions to use SQL-standard function bodies. The point of this is to remove the residual search_path security hazards that we couldn't fix in commits 7eeb1d986 et al. Since a SQL-style function body is fully parsed at creation time, its object references are not subject to capture by the run-time search path. Possibly there are small performance benefits too, though I've not tried to measure that. I've not touched the documentation yet. I suppose that we can tone down the warnings added by 7eeb1d986 quite a bit, maybe replacing them with just "be sure to use version x.y or later". However I think we may still need an assumption that earthdistance and cube are in the same schema --- any comments on that? I'd like to propose squeezing these changes into v14, even though we're past feature freeze. Reason one is that this is less a new feature than a security fix; reason two is that this provides some non-artificial test coverage for the SQL-function-body feature. BTW, there still remain a couple of old-style SQL functions in contrib/adminpack and contrib/lo. AFAICS those are unconditionally secure, so I didn't bother with them. Thoughts? regards, tom lane
Commits
-
Use @extschema:name@ notation in contrib transform modules.
- bebe9040388b 18.0 landed
-
pg_freespacemap: Fix declaration of pg_freespace(regclass)
- e0c3d5122e6a 18.0 landed
-
contrib/pageinspect: Use SQL-standard function bodies.
- 68ff25eef125 18.0 landed
-
contrib/xml2: Use SQL-standard function bodies.
- 667368fd26de 18.0 landed
-
contrib/citext: Use SQL-standard function bodies.
- 97a5a16849eb 18.0 landed
-
contrib/earthdistance: Use SQL-standard function bodies.
- 969bbd0fafc0 18.0 landed
- 3652de36e432 17.3 landed
- 31daa10facec 16.7 landed
-
contrib/lo: Use SQL-standard function bodies
- 13e3796c906b 18.0 landed
-
xml2: Add tests for functions xpath_nodeset() and xpath_list()
- 93f9b4a93fef 18.0 landed
-
contrib/lo: Add test for function lo_oid()
- 3ef038fc4f76 18.0 landed
-
pg_freespacemap: Use SQL-standard function bodies
- 3f323eba89fb 18.0 landed
-
Add @extschema:name@ and no_relocate options to extensions.
- 72a5b1fc8804 16.0 cited
-
Make contrib modules' installation scripts more secure.
- 7eeb1d9861b0 14.0 cited