plv8
PL/JavaScript (v8) 可信过程程序语言
概览
| 扩展包名 | 版本 | 分类 | 许可证 | 语言 |
|---|---|---|---|---|
plv8 | 3.2.5 | LANG | PostgreSQL | C++ |
| ID | 扩展名 | Bin | Lib | Load | Create | Trust | Reloc | 模式 |
|---|---|---|---|---|---|---|---|---|
| 3010 | plv8 | 否 | 是 | 否 | 是 | 否 | 否 | pg_catalog |
版本
| 类型 | 仓库 | 版本 | PG 大版本 | 包名 | 依赖 |
|---|---|---|---|---|---|
| EXT | PIGSTY | 3.2.5 | 1817161514 | plv8 | - |
| RPM | PIGSTY | 3.2.5 | 1817161514 | plv8_$v | - |
| DEB | PIGSTY | 3.2.5 | 1817161514 | postgresql-$v-plv8 | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 3.2.5 el8.x86_64.pg18 : plv8_18 plv8_18-3.2.5-1PGSTY.el8.x86_64.rpm
| PIGSTY 3.2.5 el8.x86_64.pg17 : plv8_17 plv8_17-3.2.5-1PGSTY.el8.x86_64.rpm
| PIGSTY 3.2.5 el8.x86_64.pg16 : plv8_16 plv8_16-3.2.5-1PGSTY.el8.x86_64.rpm
| PIGSTY 3.2.5 el8.x86_64.pg15 : plv8_15 plv8_15-3.2.5-1PGSTY.el8.x86_64.rpm
| PIGSTY 3.2.5 el8.x86_64.pg14 : plv8_14 plv8_14-3.2.5-1PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY 3.2.5 el8.aarch64.pg18 : plv8_18 plv8_18-3.2.5-1PGSTY.el8.aarch64.rpm
| PIGSTY 3.2.5 el8.aarch64.pg17 : plv8_17 plv8_17-3.2.5-1PGSTY.el8.aarch64.rpm
| PIGSTY 3.2.5 el8.aarch64.pg16 : plv8_16 plv8_16-3.2.5-1PGSTY.el8.aarch64.rpm
| PIGSTY 3.2.5 el8.aarch64.pg15 : plv8_15 plv8_15-3.2.5-1PGSTY.el8.aarch64.rpm
| PIGSTY 3.2.5 el8.aarch64.pg14 : plv8_14 plv8_14-3.2.5-1PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 3.2.5 el9.x86_64.pg18 : plv8_18 plv8_18-3.2.5-1PGSTY.el9.x86_64.rpm
| PIGSTY 3.2.5 el9.x86_64.pg17 : plv8_17 plv8_17-3.2.5-1PGSTY.el9.x86_64.rpm
| PIGSTY 3.2.5 el9.x86_64.pg16 : plv8_16 plv8_16-3.2.5-1PGSTY.el9.x86_64.rpm
| PIGSTY 3.2.5 el9.x86_64.pg15 : plv8_15 plv8_15-3.2.5-1PGSTY.el9.x86_64.rpm
| PIGSTY 3.2.5 el9.x86_64.pg14 : plv8_14 plv8_14-3.2.5-1PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 3.2.5 el9.aarch64.pg18 : plv8_18 plv8_18-3.2.5-1PGSTY.el9.aarch64.rpm
| PIGSTY 3.2.5 el9.aarch64.pg17 : plv8_17 plv8_17-3.2.5-1PGSTY.el9.aarch64.rpm
| PIGSTY 3.2.5 el9.aarch64.pg16 : plv8_16 plv8_16-3.2.5-1PGSTY.el9.aarch64.rpm
| PIGSTY 3.2.5 el9.aarch64.pg15 : plv8_15 plv8_15-3.2.5-1PGSTY.el9.aarch64.rpm
| PIGSTY 3.2.5 el9.aarch64.pg14 : plv8_14 plv8_14-3.2.5-1PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 3.2.5 el10.x86_64.pg18 : plv8_18 plv8_18-3.2.5-1PGSTY.el10.x86_64.rpm
| PIGSTY 3.2.5 el10.x86_64.pg17 : plv8_17 plv8_17-3.2.5-1PGSTY.el10.x86_64.rpm
| PIGSTY 3.2.5 el10.x86_64.pg16 : plv8_16 plv8_16-3.2.5-1PGSTY.el10.x86_64.rpm
| PIGSTY 3.2.5 el10.x86_64.pg15 : plv8_15 plv8_15-3.2.5-1PGSTY.el10.x86_64.rpm
| PIGSTY 3.2.5 el10.x86_64.pg14 : plv8_14 plv8_14-3.2.5-1PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 3.2.5 el10.aarch64.pg18 : plv8_18 plv8_18-3.2.5-1PGSTY.el10.aarch64.rpm
| PIGSTY 3.2.5 el10.aarch64.pg17 : plv8_17 plv8_17-3.2.5-1PGSTY.el10.aarch64.rpm
| PIGSTY 3.2.5 el10.aarch64.pg16 : plv8_16 plv8_16-3.2.5-1PGSTY.el10.aarch64.rpm
| PIGSTY 3.2.5 el10.aarch64.pg15 : plv8_15 plv8_15-3.2.5-1PGSTY.el10.aarch64.rpm
| PIGSTY 3.2.5 el10.aarch64.pg14 : plv8_14 plv8_14-3.2.5-1PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 3.2.5 d12.x86_64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~bookworm_amd64.deb
| PIGSTY 3.2.5 d12.x86_64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~bookworm_amd64.deb
| PIGSTY 3.2.5 d12.x86_64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~bookworm_amd64.deb
| PIGSTY 3.2.5 d12.x86_64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~bookworm_amd64.deb
| PIGSTY 3.2.5 d12.x86_64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 3.2.5 d12.aarch64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~bookworm_arm64.deb
| PIGSTY 3.2.5 d12.aarch64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~bookworm_arm64.deb
| PIGSTY 3.2.5 d12.aarch64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~bookworm_arm64.deb
| PIGSTY 3.2.5 d12.aarch64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~bookworm_arm64.deb
| PIGSTY 3.2.5 d12.aarch64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 3.2.5 d13.x86_64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~trixie_amd64.deb
| PIGSTY 3.2.5 d13.x86_64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~trixie_amd64.deb
| PIGSTY 3.2.5 d13.x86_64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~trixie_amd64.deb
| PIGSTY 3.2.5 d13.x86_64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~trixie_amd64.deb
| PIGSTY 3.2.5 d13.x86_64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 3.2.5 d13.aarch64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~trixie_arm64.deb
| PIGSTY 3.2.5 d13.aarch64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~trixie_arm64.deb
| PIGSTY 3.2.5 d13.aarch64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~trixie_arm64.deb
| PIGSTY 3.2.5 d13.aarch64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~trixie_arm64.deb
| PIGSTY 3.2.5 d13.aarch64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 3.2.5 u22.x86_64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~jammy_amd64.deb
| PIGSTY 3.2.5 u22.x86_64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~jammy_amd64.deb
| PIGSTY 3.2.5 u22.x86_64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~jammy_amd64.deb
| PIGSTY 3.2.5 u22.x86_64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~jammy_amd64.deb
| PIGSTY 3.2.5 u22.x86_64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 3.2.5 u22.aarch64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~jammy_arm64.deb
| PIGSTY 3.2.5 u22.aarch64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~jammy_arm64.deb
| PIGSTY 3.2.5 u22.aarch64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~jammy_arm64.deb
| PIGSTY 3.2.5 u22.aarch64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~jammy_arm64.deb
| PIGSTY 3.2.5 u22.aarch64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 3.2.5 u24.x86_64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~noble_amd64.deb
| PIGSTY 3.2.5 u24.x86_64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~noble_amd64.deb
| PIGSTY 3.2.5 u24.x86_64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~noble_amd64.deb
| PIGSTY 3.2.5 u24.x86_64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~noble_amd64.deb
| PIGSTY 3.2.5 u24.x86_64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 3.2.5 u24.aarch64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~noble_arm64.deb
| PIGSTY 3.2.5 u24.aarch64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~noble_arm64.deb
| PIGSTY 3.2.5 u24.aarch64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~noble_arm64.deb
| PIGSTY 3.2.5 u24.aarch64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~noble_arm64.deb
| PIGSTY 3.2.5 u24.aarch64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 3.2.5 u26.x86_64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~resolute_amd64.deb
| PIGSTY 3.2.5 u26.x86_64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~resolute_amd64.deb
| PIGSTY 3.2.5 u26.x86_64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~resolute_amd64.deb
| PIGSTY 3.2.5 u26.x86_64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~resolute_amd64.deb
| PIGSTY 3.2.5 u26.x86_64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 3.2.5 u26.aarch64.pg18 : postgresql-18-plv8 postgresql-18-plv8_3.2.5-1PGSTY~resolute_arm64.deb
| PIGSTY 3.2.5 u26.aarch64.pg17 : postgresql-17-plv8 postgresql-17-plv8_3.2.5-1PGSTY~resolute_arm64.deb
| PIGSTY 3.2.5 u26.aarch64.pg16 : postgresql-16-plv8 postgresql-16-plv8_3.2.5-1PGSTY~resolute_arm64.deb
| PIGSTY 3.2.5 u26.aarch64.pg15 : postgresql-15-plv8 postgresql-15-plv8_3.2.5-1PGSTY~resolute_arm64.deb
| PIGSTY 3.2.5 u26.aarch64.pg14 : postgresql-14-plv8 postgresql-14-plv8_3.2.5-1PGSTY~resolute_arm64.deb
|
构建
您可以使用 pig build 命令构建 plv8 扩展的 RPM / DEB 包:
安装
您可以直接安装 plv8 扩展包的预置二进制包,首先确保 PGDG 和 PIGSTY 仓库已经添加并启用:
使用 pig 或者是 apt/yum/dnf 安装扩展:
安装
pig
dnf
apt
创建扩展:
用法
来源:
plv8 基于 V8 为 PostgreSQL 提供可信的 JavaScript 存储过程语言。本文依据上游 3.2.5,包含有效用户上下文相关的崩溃修复与 PostgreSQL 19 支持。
基本使用
常用 built-ins
plv8.elog(level, ...):输出 PostgreSQL 日志或客户端消息。plv8.execute(sql [, args]):执行 SQL,并返回结果行或受影响行数。plv8.prepare(...)、PreparedPlan.execute()、PreparedPlan.cursor():提供预编译 SPI 访问。plv8.subtransaction(fn):以原子方式执行一组 SPI 操作。plv8.find_function(...):按名称调用另一个 PLV8 函数。plv8.memory_usage():查看当前会话的 V8 heap 使用情况。plv8.run_script(source, name):执行具名脚本文本。
运行时设置
plv8.start_procplv8.v8_flagsplv8.execution_timeoutplv8.memory_limit
注意事项
- 3.2.5 的 CI 矩阵覆盖 PostgreSQL 14–19;上游主版本支持与下游软件包可用范围需分别看待。
- 创建扩展需要超级用户;所安装的 JavaScript 语言属于可信语言,并不意味着普通用户可直接安装该扩展。安装 SQL 撤销了 PUBLIC 对
plv8_info()的执行权限。 - 3.2.5 修复了缓存函数经
SECURITY DEFINER、SET ROLE切换有效用户或在plv8_reset()后执行时的崩溃,也修复了异常消息无法转换为字符串时的崩溃。 - 每个 session 都有独立的全局 JavaScript runtime;切换 role 会初始化单独的 runtime context。
plv8.execution_timeout仅在扩展以 execution-timeout 支持编译时生效。
这个页面对您有帮助吗?
感谢反馈,我们会据此改进这篇文档。
哪里没有解决?(可选)