jsonb_plphp
plphp · Transform between jsonb and native PHP values for PL/php
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101858 | jsonb_plphp | plphp | 1.0 | LANG | PostgreSQL | C |
PostgreSQL · 11, 12, 13, 14, 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | plphp |
Usage
Sources:
jsonb_plphp adds a PostgreSQL transform between jsonb and native PHP arrays, scalars, booleans, and nulls for functions written in plphp. It is a companion to the untrusted PL/php runtime, not an independent procedural language.
Core Workflow
CASCADE creates plphp when available. Only functions that declare TRANSFORM FOR TYPE jsonb receive native PHP values. The transform also applies in supported nested composite, array, set-returning, and trigger contexts; SPI result rows remain on their normal text-conversion path.
Boundaries
jsonb_plphp requires the same superuser installation and trust model as plphp: PHP code can access the PostgreSQL server account’s files, network, and process environment. JSON objects become associative PHP arrays, so review key coercion and the distinction among arrays, objects, numeric values, and nulls. Test large or deeply nested documents for memory use and conversion behavior.
The transform’s control version is 1.0 and it is shipped in the PL/php 2.6.0 distribution. It requires no preload, but the PHP embed SAPI and the plphp shared library must already be usable on PostgreSQL 11 through 18.