]> granicus.if.org Git - postgresql/blob - contrib/hstore_plpython/hstore_plpython2u--1.0.sql
Separate block sampling functions
[postgresql] / contrib / hstore_plpython / hstore_plpython2u--1.0.sql
1 -- make sure the prerequisite libraries are loaded
2 DO '1' LANGUAGE plpython2u;
3 SELECT NULL::hstore;
4
5
6 CREATE FUNCTION hstore_to_plpython2(val internal) RETURNS internal
7 LANGUAGE C STRICT IMMUTABLE
8 AS 'MODULE_PATHNAME', 'hstore_to_plpython';
9
10 CREATE FUNCTION plpython2_to_hstore(val internal) RETURNS hstore
11 LANGUAGE C STRICT IMMUTABLE
12 AS 'MODULE_PATHNAME', 'plpython_to_hstore';
13
14 CREATE TRANSFORM FOR hstore LANGUAGE plpython2u (
15     FROM SQL WITH FUNCTION hstore_to_plpython2(internal),
16     TO SQL WITH FUNCTION plpython2_to_hstore(internal)
17 );
18
19 COMMENT ON TRANSFORM FOR hstore LANGUAGE plpython2u IS 'transform between hstore and Python dict';