aboutsummaryrefslogtreecommitdiff
path: root/contrib/hstore_plpython
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-01-09 15:16:56 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2025-01-09 15:16:56 -0500
commitbebe9040388bb2292585eab712fe4d29a71843fb (patch)
treebc665989a9135290e57b623df27ebd35bef8bd64 /contrib/hstore_plpython
parentebd8fc7e47fdad6adb68aad341d95c541d7325c3 (diff)
downloadpostgresql-bebe9040388bb2292585eab712fe4d29a71843fb.tar.gz
postgresql-bebe9040388bb2292585eab712fe4d29a71843fb.zip
Use @extschema:name@ notation in contrib transform modules.
Harden hstore_plperl, hstore_plpython, and ltree_plpython against search-path-based attacks by using @extschema:name@ notation to refer to the underlying hstore or ltree data type. This allows removal of the previous documentation warning suggesting that they must be installed in the same schema as the underlying data type. In passing, also improve a para in extend.sgml to suggest using @extschema:name@ for such purposes. Discussion: https://postgr.es/m/692480.1736021695@sss.pgh.pa.us
Diffstat (limited to 'contrib/hstore_plpython')
-rw-r--r--contrib/hstore_plpython/hstore_plpython3u--1.0.sql6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/hstore_plpython/hstore_plpython3u--1.0.sql b/contrib/hstore_plpython/hstore_plpython3u--1.0.sql
index 0b410ab1835..35082322416 100644
--- a/contrib/hstore_plpython/hstore_plpython3u--1.0.sql
+++ b/contrib/hstore_plpython/hstore_plpython3u--1.0.sql
@@ -7,13 +7,13 @@ CREATE FUNCTION hstore_to_plpython3(val internal) RETURNS internal
LANGUAGE C STRICT IMMUTABLE
AS 'MODULE_PATHNAME', 'hstore_to_plpython';
-CREATE FUNCTION plpython3_to_hstore(val internal) RETURNS hstore
+CREATE FUNCTION plpython3_to_hstore(val internal) RETURNS @extschema:hstore@.hstore
LANGUAGE C STRICT IMMUTABLE
AS 'MODULE_PATHNAME', 'plpython_to_hstore';
-CREATE TRANSFORM FOR hstore LANGUAGE plpython3u (
+CREATE TRANSFORM FOR @extschema:hstore@.hstore LANGUAGE plpython3u (
FROM SQL WITH FUNCTION hstore_to_plpython3(internal),
TO SQL WITH FUNCTION plpython3_to_hstore(internal)
);
-COMMENT ON TRANSFORM FOR hstore LANGUAGE plpython3u IS 'transform between hstore and Python dict';
+COMMENT ON TRANSFORM FOR @extschema:hstore@.hstore LANGUAGE plpython3u IS 'transform between hstore and Python dict';