mirror of
https://github.com/postgres/postgres.git
synced 2025-06-19 04:21:08 +03:00
config
contrib
adminpack
amcheck
auth_delay
auto_explain
bloom
btree_gin
btree_gist
citext
cube
dblink
dict_int
dict_xsyn
earthdistance
file_fdw
fuzzystrmatch
hstore
hstore_plperl
hstore_plpython
intagg
intarray
isn
jsonb_plperl
expected
sql
.gitignore
Makefile
jsonb_plperl--1.0.sql
jsonb_plperl.c
jsonb_plperl.control
jsonb_plperlu--1.0.sql
jsonb_plperlu.control
jsonb_plpython
lo
ltree
ltree_plpython
oid2name
pageinspect
passwordcheck
pg_buffercache
pg_freespacemap
pg_prewarm
pg_standby
pg_stat_statements
pg_trgm
pg_visibility
pgcrypto
pgrowlocks
pgstattuple
postgres_fdw
seg
sepgsql
spi
sslinfo
start-scripts
tablefunc
tcn
test_decoding
tsm_system_rows
tsm_system_time
unaccent
uuid-ossp
vacuumlo
xml2
Makefile
README
contrib-global.mk
doc
src
.dir-locals.el
.gitattributes
.gitignore
COPYRIGHT
GNUmakefile.in
HISTORY
Makefile
README
README.git
aclocal.m4
configure
configure.in
Add a new contrib module jsonb_plperl that provides a transform between jsonb and PL/Perl. jsonb values are converted to appropriate Perl types such as arrays and hashes, and vice versa. Author: Anthony Bykov <a.bykov@postgrespro.ru> Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com> Reviewed-by: Aleksander Alekseev <a.alekseev@postgrespro.ru> Reviewed-by: Nikita Glukhov <n.gluhov@postgrespro.ru>
20 lines
658 B
SQL
20 lines
658 B
SQL
/* contrib/jsonb_plperl/jsonb_plperl--1.0.sql */
|
|
|
|
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
|
\echo Use "CREATE EXTENSION jsonb_plperl" to load this file. \quit
|
|
|
|
CREATE FUNCTION jsonb_to_plperl(val internal) RETURNS internal
|
|
LANGUAGE C STRICT IMMUTABLE
|
|
AS 'MODULE_PATHNAME';
|
|
|
|
CREATE FUNCTION plperl_to_jsonb(val internal) RETURNS jsonb
|
|
LANGUAGE C STRICT IMMUTABLE
|
|
AS 'MODULE_PATHNAME';
|
|
|
|
CREATE TRANSFORM FOR jsonb LANGUAGE plperl (
|
|
FROM SQL WITH FUNCTION jsonb_to_plperl(internal),
|
|
TO SQL WITH FUNCTION plperl_to_jsonb(internal)
|
|
);
|
|
|
|
COMMENT ON TRANSFORM FOR jsonb LANGUAGE plperl IS 'transform between jsonb and Perl';
|