pgml
pgml
Run AL/ML workloads with SQL interface
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 1890 | pgml | pgml | 2.10.0 | RAG | MIT | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--sLd-- | No | Yes | Yes | Yes | no | no |
| Relationships | |
|---|---|
| See Also | pg4ml vectorize pg_summarize pg_tiktoken vector vchord vectorscale pg_strom |
pgrx=0.12.9
Packages
| Type | Repo | Version | PG Major Availability | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EL | PIGSTY | 2.10.0 | 18 17 16 15 14 13 | pgml_$v | - |
| Debian | PIGSTY | 2.10.0 | 18 17 16 15 14 13 | postgresql-$v-pgml | - |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 | PG13 |
|---|---|---|---|---|---|---|
el8.x86_64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 |
el8.aarch64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 |
el9.x86_64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.9.3 | PIGSTY 2.9.3 | PIGSTY 2.9.3 | PIGSTY 2.10.0 |
el9.aarch64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 |
el10.x86_64 | MISS | MISS | MISS | MISS | MISS | MISS |
el10.aarch64 | MISS | MISS | MISS | MISS | MISS | MISS |
d12.x86_64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 |
d12.aarch64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 |
d13.x86_64 | MISS | MISS | MISS | MISS | MISS | MISS |
d13.aarch64 | MISS | MISS | MISS | MISS | MISS | MISS |
u22.x86_64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 |
u22.aarch64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 |
u24.x86_64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 |
u24.aarch64 | MISS | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 | PIGSTY 2.10.0 |
| Package | Version | OS | ORG | SIZE | File URL |
|---|---|---|---|---|---|
pgml_17 | 2.10.0 | el8.x86_64 | pigsty | 5.7 MiB | pgml_17-2.10.0-1PIGSTY.el8.x86_64.rpm |
pgml_17 | 2.10.0 | el8.aarch64 | pigsty | 4.8 MiB | pgml_17-2.10.0-1PIGSTY.el8.aarch64.rpm |
pgml_17 | 2.10.0 | el9.x86_64 | pigsty | 5.3 MiB | pgml_17-2.10.0-1PIGSTY.el9.x86_64.rpm |
pgml_17 | 2.10.0 | el9.aarch64 | pigsty | 5.1 MiB | pgml_17-2.10.0-1PIGSTY.el9.aarch64.rpm |
postgresql-17-pgml | 2.10.0 | d12.x86_64 | pigsty | 4.7 MiB | postgresql-17-pgml_2.10.0-1PIGSTY~bookworm_amd64.deb |
postgresql-17-pgml | 2.10.0 | d12.aarch64 | pigsty | 4.0 MiB | postgresql-17-pgml_2.10.0-1PIGSTY~bookworm_arm64.deb |
postgresql-17-pgml | 2.10.0 | u22.x86_64 | pigsty | 5.1 MiB | postgresql-17-pgml_2.10.0-1PIGSTY~jammy_amd64.deb |
postgresql-17-pgml | 2.10.0 | u22.aarch64 | pigsty | 4.8 MiB | postgresql-17-pgml_2.10.0-1PIGSTY~jammy_arm64.deb |
postgresql-17-pgml | 2.10.0 | u24.x86_64 | pigsty | 5.4 MiB | postgresql-17-pgml_2.10.0-1PIGSTY~noble_amd64.deb |
postgresql-17-pgml | 2.10.0 | u24.aarch64 | pigsty | 4.9 MiB | postgresql-17-pgml_2.10.0-1PIGSTY~noble_arm64.deb |
| Package | Version | OS | ORG | SIZE | File URL |
|---|---|---|---|---|---|
pgml_16 | 2.10.0 | el8.x86_64 | pigsty | 5.7 MiB | pgml_16-2.10.0-1PIGSTY.el8.x86_64.rpm |
pgml_16 | 2.10.0 | el8.aarch64 | pigsty | 4.8 MiB | pgml_16-2.10.0-1PIGSTY.el8.aarch64.rpm |
pgml_16 | 2.9.3 | el9.x86_64 | pigsty | 4.6 MiB | pgml_16-2.9.3-1PIGSTY.el9.x86_64.rpm |
pgml_16 | 2.10.0 | el9.x86_64 | pigsty | 5.3 MiB | pgml_16-2.10.0-1PIGSTY.el9.x86_64.rpm |
pgml_16 | 2.10.0 | el9.aarch64 | pigsty | 5.1 MiB | pgml_16-2.10.0-1PIGSTY.el9.aarch64.rpm |
postgresql-16-pgml | 2.10.0 | d12.x86_64 | pigsty | 4.7 MiB | postgresql-16-pgml_2.10.0-1PIGSTY~bookworm_amd64.deb |
postgresql-16-pgml | 2.10.0 | d12.aarch64 | pigsty | 4.0 MiB | postgresql-16-pgml_2.10.0-1PIGSTY~bookworm_arm64.deb |
postgresql-16-pgml | 2.10.0 | u22.x86_64 | pigsty | 5.1 MiB | postgresql-16-pgml_2.10.0-1PIGSTY~jammy_amd64.deb |
postgresql-16-pgml | 2.10.0 | u22.aarch64 | pigsty | 4.8 MiB | postgresql-16-pgml_2.10.0-1PIGSTY~jammy_arm64.deb |
postgresql-16-pgml | 2.10.0 | u24.x86_64 | pigsty | 5.4 MiB | postgresql-16-pgml_2.10.0-1PIGSTY~noble_amd64.deb |
postgresql-16-pgml | 2.10.0 | u24.aarch64 | pigsty | 4.9 MiB | postgresql-16-pgml_2.10.0-1PIGSTY~noble_arm64.deb |
| Package | Version | OS | ORG | SIZE | File URL |
|---|---|---|---|---|---|
pgml_15 | 2.10.0 | el8.x86_64 | pigsty | 5.7 MiB | pgml_15-2.10.0-1PIGSTY.el8.x86_64.rpm |
pgml_15 | 2.10.0 | el8.aarch64 | pigsty | 4.8 MiB | pgml_15-2.10.0-1PIGSTY.el8.aarch64.rpm |
pgml_15 | 2.9.3 | el9.x86_64 | pigsty | 4.6 MiB | pgml_15-2.9.3-1PIGSTY.el9.x86_64.rpm |
pgml_15 | 2.10.0 | el9.x86_64 | pigsty | 5.3 MiB | pgml_15-2.10.0-1PIGSTY.el9.x86_64.rpm |
pgml_15 | 2.10.0 | el9.aarch64 | pigsty | 5.1 MiB | pgml_15-2.10.0-1PIGSTY.el9.aarch64.rpm |
postgresql-15-pgml | 2.10.0 | d12.x86_64 | pigsty | 4.7 MiB | postgresql-15-pgml_2.10.0-1PIGSTY~bookworm_amd64.deb |
postgresql-15-pgml | 2.10.0 | d12.aarch64 | pigsty | 4.0 MiB | postgresql-15-pgml_2.10.0-1PIGSTY~bookworm_arm64.deb |
postgresql-15-pgml | 2.10.0 | u22.x86_64 | pigsty | 5.1 MiB | postgresql-15-pgml_2.10.0-1PIGSTY~jammy_amd64.deb |
postgresql-15-pgml | 2.10.0 | u22.aarch64 | pigsty | 4.8 MiB | postgresql-15-pgml_2.10.0-1PIGSTY~jammy_arm64.deb |
postgresql-15-pgml | 2.10.0 | u24.x86_64 | pigsty | 5.4 MiB | postgresql-15-pgml_2.10.0-1PIGSTY~noble_amd64.deb |
postgresql-15-pgml | 2.10.0 | u24.aarch64 | pigsty | 4.9 MiB | postgresql-15-pgml_2.10.0-1PIGSTY~noble_arm64.deb |
| Package | Version | OS | ORG | SIZE | File URL |
|---|---|---|---|---|---|
pgml_14 | 2.10.0 | el8.x86_64 | pigsty | 5.7 MiB | pgml_14-2.10.0-1PIGSTY.el8.x86_64.rpm |
pgml_14 | 2.10.0 | el8.aarch64 | pigsty | 4.8 MiB | pgml_14-2.10.0-1PIGSTY.el8.aarch64.rpm |
pgml_14 | 2.9.3 | el9.x86_64 | pigsty | 4.6 MiB | pgml_14-2.9.3-1PIGSTY.el9.x86_64.rpm |
pgml_14 | 2.10.0 | el9.x86_64 | pigsty | 5.3 MiB | pgml_14-2.10.0-1PIGSTY.el9.x86_64.rpm |
pgml_14 | 2.10.0 | el9.aarch64 | pigsty | 5.1 MiB | pgml_14-2.10.0-1PIGSTY.el9.aarch64.rpm |
postgresql-14-pgml | 2.10.0 | d12.x86_64 | pigsty | 4.7 MiB | postgresql-14-pgml_2.10.0-1PIGSTY~bookworm_amd64.deb |
postgresql-14-pgml | 2.10.0 | d12.aarch64 | pigsty | 4.0 MiB | postgresql-14-pgml_2.10.0-1PIGSTY~bookworm_arm64.deb |
postgresql-14-pgml | 2.10.0 | u22.x86_64 | pigsty | 5.1 MiB | postgresql-14-pgml_2.10.0-1PIGSTY~jammy_amd64.deb |
postgresql-14-pgml | 2.10.0 | u22.aarch64 | pigsty | 4.8 MiB | postgresql-14-pgml_2.10.0-1PIGSTY~jammy_arm64.deb |
postgresql-14-pgml | 2.10.0 | u24.x86_64 | pigsty | 5.4 MiB | postgresql-14-pgml_2.10.0-1PIGSTY~noble_amd64.deb |
postgresql-14-pgml | 2.10.0 | u24.aarch64 | pigsty | 4.9 MiB | postgresql-14-pgml_2.10.0-1PIGSTY~noble_arm64.deb |
| Package | Version | OS | ORG | SIZE | File URL |
|---|---|---|---|---|---|
pgml_13 | 2.10.0 | el8.x86_64 | pigsty | 5.7 MiB | pgml_13-2.10.0-1PIGSTY.el8.x86_64.rpm |
pgml_13 | 2.10.0 | el8.aarch64 | pigsty | 4.8 MiB | pgml_13-2.10.0-1PIGSTY.el8.aarch64.rpm |
pgml_13 | 2.10.0 | el9.x86_64 | pigsty | 5.3 MiB | pgml_13-2.10.0-1PIGSTY.el9.x86_64.rpm |
pgml_13 | 2.10.0 | el9.aarch64 | pigsty | 5.1 MiB | pgml_13-2.10.0-1PIGSTY.el9.aarch64.rpm |
postgresql-13-pgml | 2.10.0 | d12.x86_64 | pigsty | 4.7 MiB | postgresql-13-pgml_2.10.0-1PIGSTY~bookworm_amd64.deb |
postgresql-13-pgml | 2.10.0 | d12.aarch64 | pigsty | 4.0 MiB | postgresql-13-pgml_2.10.0-1PIGSTY~bookworm_arm64.deb |
postgresql-13-pgml | 2.10.0 | u22.x86_64 | pigsty | 5.1 MiB | postgresql-13-pgml_2.10.0-1PIGSTY~jammy_amd64.deb |
postgresql-13-pgml | 2.10.0 | u22.aarch64 | pigsty | 4.8 MiB | postgresql-13-pgml_2.10.0-1PIGSTY~jammy_arm64.deb |
postgresql-13-pgml | 2.10.0 | u24.x86_64 | pigsty | 5.4 MiB | postgresql-13-pgml_2.10.0-1PIGSTY~noble_amd64.deb |
postgresql-13-pgml | 2.10.0 | u24.aarch64 | pigsty | 4.9 MiB | postgresql-13-pgml_2.10.0-1PIGSTY~noble_arm64.deb |
Source
pig build get pgml; # get pgml source code
pig build dep pgml; # install build dependencies
pig build pkg pgml; # build extension rpm or deb
pig build ext pgml; # build extension rpmsInstall
To add the required PGDG / PIGSTY upstream repository, use:
pig repo add pgsql -u # add PGDG + Pigsty repo and update cache (leave existing repos)Install this extension with:
pig ext install pgml; # install by extension name, for the current active PG version
pig ext install pgml; # install via package alias, for the active PG version
pig ext install pgml -v 17; # install for PG 17
pig ext install pgml -v 16; # install for PG 16
pig ext install pgml -v 15; # install for PG 15
pig ext install pgml -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION pgml CASCADE SCHEMA pgml;Usage
The PGML team seems not maintaining this extension for a while.
After installing the pgml extension and python dependencies on all cluster nodes, you can enable pgml on the PostgreSQL cluster.
Configure cluster with patronictl command and add pgml to shared_preload_libraries, and specify your venv dir in pgml.venv:
shared_preload_libraries: pgml, timescaledb, pg_stat_statements, auto_explain
pgml.venv: '/data/pgml'After that, restart database cluster, and create extension with SQL command:
CREATE EXTENSION vector; -- nice to have pgvector installed too!
CREATE EXTENSION pgml; -- create PostgresML in current database
SELECT pgml.version(); -- print PostgresML version stringIf it works, you should see something like:
# create extension pgml;
INFO: Python version: 3.11.2 (main, Oct 5 2023, 16:06:03) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)]
INFO: Scikit-learn 1.3.0, XGBoost 2.0.0, LightGBM 4.1.0, NumPy 1.26.1
CREATE EXTENSION
# SELECT pgml.version(); -- print PostgresML version string
version
---------
2.7.8You are all set! Check PostgresML for more details: https://postgresml.org/docs/guides/use-cases/
Last updated on