plv8
PL/JavaScript (v8) trusted procedural language
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 |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 3.2.4 |
18 17 16 15 14 | plv8 |
- |
| RPM | PIGSTY | 3.2.4 |
18 17 16 15 14 | plv8_$v |
- |
| DEB | PIGSTY | 3.2.4 |
18 17 16 15 14 | postgresql-$v-plv8 |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | 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 |
| el9.x86_64 | 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 |
| el10.x86_64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
| el10.aarch64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
| d12.x86_64 | 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 |
| d13.x86_64 | 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 |
| u22.x86_64 | 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 |
| u24.x86_64 | 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 |
| u26.x86_64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
| u26.aarch64 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 | PIGSTY 3.2.4 |
Source
github.com/plv8/plv8
plv8-3.2.4.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Source: README, Docs site, Built-ins, Runtime configuration, Tag v3.2.4
plv8 is a trusted JavaScript procedural language for PostgreSQL, powered by the V8 engine. Upstream currently tags the extension as v3.2.4; Pigsty’s 3.2.4-2 package version is a packaging revision rather than a new upstream extension release.
Basic use
Common built-ins
plv8.elog(level, ...): emit PostgreSQL log or client messages.plv8.execute(sql [, args]): run SQL and return rows or affected-row count.plv8.prepare(...),PreparedPlan.execute(),PreparedPlan.cursor(): prepared SPI access.plv8.subtransaction(fn): run a group of SPI operations atomically.plv8.find_function(...): call another PLV8 function by name.plv8.memory_usage(): inspect V8 heap usage for the current session.plv8.run_script(source, name): evaluate named script text.
Runtime settings
plv8.start_procplv8.v8_flagsplv8.execution_timeoutplv8.memory_limit
Caveats
- Current docs state support for PostgreSQL 13 and above.
- Each session has its own global JavaScript runtime; switching roles initializes a separate runtime context.
plv8.execution_timeoutonly applies when the extension is compiled with execution-timeout support.