plv8
plv8
plv8 : PL/JavaScript (v8) trusted procedural language
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 3010 | plv8 | plv8 | 3.2.4 | LANG | PostgreSQL | C++ |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| See Also | plpgsql pg_jsonschema jsquery plperl plpython3u pg_tle pllua plluau |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 3.2.4 | 18 17 16 15 14 13 | plv8 | - |
| RPM | PIGSTY | 3.2.4 | 18 17 16 15 14 13 | plv8_$v* | - |
| DEB | PIGSTY | 3.2.4 | 18 17 16 15 14 13 | postgresql-$v-plv8 | - |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 | PG13 |
|---|---|---|---|---|---|---|
el8.x86_64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
el8.aarch64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
el9.x86_64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
el9.aarch64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
el10.x86_64 | MISS | MISS | MISS | MISS | MISS | MISS |
el10.aarch64 | MISS | MISS | MISS | MISS | MISS | MISS |
d12.x86_64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
d12.aarch64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
d13.x86_64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
d13.aarch64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
u22.x86_64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
u22.aarch64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
u24.x86_64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
u24.aarch64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
Source
pig build pkg plv8; # build rpm / deb with pigInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgdg pigsty -u # add both repo and update cacheInstall this extension with pig:
pig install plv8; # install via package name, for the active PG version
pig install plv8 -v 18; # install for PG 18
pig install plv8 -v 17; # install for PG 17
pig install plv8 -v 16; # install for PG 16
pig install plv8 -v 15; # install for PG 15
pig install plv8 -v 14; # install for PG 14
pig install plv8 -v 13; # install for PG 13Create this extension with:
CREATE EXTENSION plv8;Usage
CREATE EXTENSION plv8;
SELECT plv8_version();
SELECT plv8_info();
DO $$ plv8.elog(NOTICE, plv8.version); $$ LANGUAGE plv8;Example:
CREATE FUNCTION plv8_test(keys TEXT[], vals TEXT[]) RETURNS JSON AS $$
var o = {};
for(var i=0; i<keys.length; i++){
o[keys[i]] = vals[i];
}
return o;
$$ LANGUAGE plv8 IMMUTABLE STRICT;
SELECT plv8_test(ARRAY['name', 'age'], ARRAY['Tom', '29']);Build
Plv8 build breaks on EL10 (x86/arm) with the following problems:
- find g++ problem
- g++ 14 include
<algorithm>problem - lto problem, g++14 link time optimization issue
Last updated on