Contents
hstore_plperl
A contrib module providing hstore transforms for PL/Perl
hstore_plperl
is a contrib module implementing transforms for the hstore
type for PL/Perl and (as hstore_plperlu
) for PL/PerlU.
hstore_plperl
was added in PostgreSQL 9.5.
Change history
- PostgreSQL 13
- marked as a trusted extension (commit eb67623c)
- PostgreSQL 9.5
- added (commit cac76582)
Examples
Usage example (using the untrusted variant hstore_plperlu
to be able to use the Data::Dumper
module):
postgres=# CREATE EXTENSION hstore_plperlu CASCADE; NOTICE: installing required extension "hstore" NOTICE: installing required extension "plperlu" postgres=# CREATE FUNCTION hello_hstore(hstore) RETURNS TEXT TRANSFORM FOR TYPE hstore LANGUAGE plperlu AS $$ my $params = shift; use Data::Dumper; elog(INFO, Dumper($params)); $params->{message} //= 'world'; return sprintf('hello %s', $params->{message}); $$; CREATE FUNCTION postgres=# SELECT hello_hstore('message=>"universe"'); INFO: $VAR1 = { 'message' => 'universe' }; hello_hstore ---------------- hello universe (1 row)
References
- PostgreSQL documentation: hstore