Docker image with installed PLV8 extension and BigInt numbers support on PostgreSQL 17 and 16
10K+
Compact Debian/Alpine based docker image for PLV8 on Postgres incl. latest 17.5 and 16.10. Runs on Windows, Linux and Mac (with Apple silicon M1/M2/M3 support). Alpine-based images are enhanced adaptations of the official Postgres image, while Debian-based images are expanded versions of the Bitnami PostgreSQL package. Unlike default PLV8 build this modification supports BigInt numbers.
Support and periodic update releases for all versions PostgreSQL 17 and PostgreSQL 16.
This repository is free to use.
Dockerfile linksamd64, arm64 architectures support:17.6-3.2.4, latest, 17.6-3.2.4-alpine, alpine17.6-3.2.4-bookworm, bookworm16.10-3.2.3, 16.10-3.2.3-alpine16.10-3.2.3-bookworm15.8-3.2.2, 15.8-3.2.2-alpine15.8-3.2.2-bookworm14.9-3.1.7, 14.9-3.1.7-alpineamd64 architecture support:This image is installed like the standard Postgres image. The only discrepancy is the complement PLV8 extension.
Create extension script should be executed first:
CREATE EXTENSION plv8;
Then you can perform SQL query:
DO $$
plv8.elog(NOTICE, plv8.version);
$$ LANGUAGE plv8;
You should see the version of the PLV8 extension installed.
Because of BigInt serialization issue this image comes in two variants:
sibedge/postgres-plv8, default build (by default in PLV8 v3.0.0 and higher BigInt numbers are converted into string).sibedge/postgres-plv8-bigint, special mod with BigInt serialization support.DO $$
const sql = "SELECT COUNT(*) FROM generate_series(1, 100);";
const data = plv8.execute(sql);
plv8.elog(NOTICE, JSON.stringify(data[0]));
$$ LANGUAGE plv8;
sibedge/postgres-plv8 result: ERROR: TypeError: Do not know how to serialize a BigIntsibedge/postgres-plv8-bigint result: NOTICE: {"count":100}Conversion to JSONB test:
CREATE TABLE test
(
id SERIAL PRIMARY KEY NOT NULL,
comment text
);
INSERT INTO test(comment)
VALUES ('abc'), ('def');
CREATE OR REPLACE FUNCTION get_count(table_name text)
RETURNS jsonb
LANGUAGE plv8 IMMUTABLE AS
$$
const sql = `SELECT COUNT(*) AS cnt FROM "${table_name}"`;
const data = plv8.execute(sql);
return data[0];
$$;
SELECT * FROM get_count('test');
sibedge/postgres-plv8 result: {"cnt": "2"}sibedge/postgres-plv8-bigint result: {"cnt": 2}Ask your questions via email: [email protected]
Content type
Image
Digest
sha256:818b25412…
Size
111.7 MB
Last updated
about 1 year ago
docker pull sibedge/postgres-plv8-bigint