1 /* contrib/jsonb_plpython/jsonb_plpython3u--1.0.sql */
3 -- complain if script is sourced in psql, rather than via CREATE EXTENSION
4 \echo Use "CREATE EXTENSION jsonb_plpython3u" to load this file. \quit
6 CREATE FUNCTION jsonb_to_plpython3(val internal) RETURNS internal
7 LANGUAGE C STRICT IMMUTABLE
8 AS 'MODULE_PATHNAME', 'jsonb_to_plpython';
10 CREATE FUNCTION plpython3_to_jsonb(val internal) RETURNS jsonb
11 LANGUAGE C STRICT IMMUTABLE
12 AS 'MODULE_PATHNAME', 'plpython_to_jsonb';
14 CREATE TRANSFORM FOR jsonb LANGUAGE plpython3u (
15 FROM SQL WITH FUNCTION jsonb_to_plpython3(internal),
16 TO SQL WITH FUNCTION plpython3_to_jsonb(internal)
19 COMMENT ON TRANSFORM FOR jsonb LANGUAGE plpython3u IS 'transform between jsonb and Python';