The extension hstore_plpython3u is supposed to transform hstore to/from python dict as described in the docs, but doesn't seem to work. The hstore becomes a string (no transform seems to happen). Why, and how to fix it?
The extensions for PL/Python are called hstore_plpythonu, hstore_plpython2u, and hstore_plpython3u (see Section 45.1 for the PL/Python naming convention). If you use them, hstore values are mapped to Python dictionaries. https://www.postgresql.org/docs/current/hstore.html
Create extensions
create extension plpython3u;
create extension hstore_plpython3u;
Create a function
create function type(names hstore)
returns text
language plpython3u as $$
return type(names);
$$;
Call function
select type(hstore('name','martin'));
returns
type
---------------
<class 'str'>
(1 row)