1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Transforms for jsonb to PL/Python

Add a new contrib module jsonb_plpython that provide a transform between
jsonb and PL/Python.  jsonb values are converted to appropriate Python
types such as dicts and lists, and vice versa.

Author: Anthony Bykov <a.bykov@postgrespro.ru>
Reviewed-by: Aleksander Alekseev <a.alekseev@postgrespro.ru>
Reviewed-by: Nikita Glukhov <n.gluhov@postgrespro.ru>
This commit is contained in:
Peter Eisentraut
2018-03-28 08:32:43 -04:00
parent a437551a22
commit 3f44e3db72
13 changed files with 1155 additions and 2 deletions

View File

@ -569,4 +569,19 @@ SELECT jdoc-&gt;'guid', jdoc-&gt;'name' FROM api WHERE jdoc @&gt; '{"tags": ["qu
compared using the default database collation.
</para>
</sect2>
<sect2>
<title>Transforms</title>
<para>
Additional extensions are available that implement transforms for the
<type>jsonb</type> type for the language PL/Python. The extensions for
PL/Python are called <literal>jsonb_plpythonu</literal>,
<literal>jsonb_plpython2u</literal>, and
<literal>jsonb_plpython3u</literal> (see <xref
linkend="plpython-python23"/> for the PL/Python naming convention). If you
use them, <type>jsonb</type> values are mapped to Python dictionaries,
lists, and scalars, as appropriate.
</para>
</sect2>
</sect1>