pgml
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgml | 2.10.0 | RAG | MIT | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 1890 | pgml | No | Yes | Yes | Yes | No | No | pgml |
| Related | pg4ml vectorize pg_summarize pg_tiktoken vector vchord vectorscale pg_strom |
|---|
pgrx=0.12.9
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 2.10.0 | 1817161514 | pgml | - |
| RPM | PIGSTY | 2.10.0 | 1817161514 | pgml_$v | - |
| DEB | PIGSTY | 2.10.0 | 1817161514 | postgresql-$v-pgml | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY MISS | PIGSTY 2.10.0 el8.x86_64.pg17 : pgml_17 pgml_17-2.10.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY 2.10.0 el8.x86_64.pg16 : pgml_16 pgml_16-2.10.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY 2.10.0 el8.x86_64.pg15 : pgml_15 pgml_15-2.10.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY 2.10.0 el8.x86_64.pg14 : pgml_14 pgml_14-2.10.0-1PIGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY MISS | PIGSTY 2.10.0 el8.aarch64.pg17 : pgml_17 pgml_17-2.10.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY 2.10.0 el8.aarch64.pg16 : pgml_16 pgml_16-2.10.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY 2.10.0 el8.aarch64.pg15 : pgml_15 pgml_15-2.10.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY 2.10.0 el8.aarch64.pg14 : pgml_14 pgml_14-2.10.0-1PIGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY MISS | PIGSTY 2.10.0 el9.x86_64.pg17 : pgml_17 pgml_17-2.10.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 2.10.0 el9.x86_64.pg16 : pgml_16 pgml_16-2.10.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 2.10.0 el9.x86_64.pg15 : pgml_15 pgml_15-2.10.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 2.10.0 el9.x86_64.pg14 : pgml_14 pgml_14-2.10.0-1PIGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY MISS | PIGSTY 2.10.0 el9.aarch64.pg17 : pgml_17 pgml_17-2.10.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 2.10.0 el9.aarch64.pg16 : pgml_16 pgml_16-2.10.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 2.10.0 el9.aarch64.pg15 : pgml_15 pgml_15-2.10.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 2.10.0 el9.aarch64.pg14 : pgml_14 pgml_14-2.10.0-1PIGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el10.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| d12.x86_64 | PIGSTY MISS | PIGSTY 2.10.0 d12.x86_64.pg17 : postgresql-17-pgml postgresql-17-pgml_2.10.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 2.10.0 d12.x86_64.pg16 : postgresql-16-pgml postgresql-16-pgml_2.10.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 2.10.0 d12.x86_64.pg15 : postgresql-15-pgml postgresql-15-pgml_2.10.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 2.10.0 d12.x86_64.pg14 : postgresql-14-pgml postgresql-14-pgml_2.10.0-1PIGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY MISS | PIGSTY 2.10.0 d12.aarch64.pg17 : postgresql-17-pgml postgresql-17-pgml_2.10.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 2.10.0 d12.aarch64.pg16 : postgresql-16-pgml postgresql-16-pgml_2.10.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 2.10.0 d12.aarch64.pg15 : postgresql-15-pgml postgresql-15-pgml_2.10.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 2.10.0 d12.aarch64.pg14 : postgresql-14-pgml postgresql-14-pgml_2.10.0-1PIGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| d13.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| u22.x86_64 | PIGSTY MISS | PIGSTY 2.10.0 u22.x86_64.pg17 : postgresql-17-pgml postgresql-17-pgml_2.10.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 2.10.0 u22.x86_64.pg16 : postgresql-16-pgml postgresql-16-pgml_2.10.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 2.10.0 u22.x86_64.pg15 : postgresql-15-pgml postgresql-15-pgml_2.10.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 2.10.0 u22.x86_64.pg14 : postgresql-14-pgml postgresql-14-pgml_2.10.0-1PIGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY MISS | PIGSTY 2.10.0 u22.aarch64.pg17 : postgresql-17-pgml postgresql-17-pgml_2.10.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 2.10.0 u22.aarch64.pg16 : postgresql-16-pgml postgresql-16-pgml_2.10.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 2.10.0 u22.aarch64.pg15 : postgresql-15-pgml postgresql-15-pgml_2.10.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 2.10.0 u22.aarch64.pg14 : postgresql-14-pgml postgresql-14-pgml_2.10.0-1PIGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY MISS | PIGSTY 2.10.0 u24.x86_64.pg17 : postgresql-17-pgml postgresql-17-pgml_2.10.0-1PIGSTY~noble_amd64.deb
| PIGSTY 2.10.0 u24.x86_64.pg16 : postgresql-16-pgml postgresql-16-pgml_2.10.0-1PIGSTY~noble_amd64.deb
| PIGSTY 2.10.0 u24.x86_64.pg15 : postgresql-15-pgml postgresql-15-pgml_2.10.0-1PIGSTY~noble_amd64.deb
| PIGSTY 2.10.0 u24.x86_64.pg14 : postgresql-14-pgml postgresql-14-pgml_2.10.0-1PIGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY MISS | PIGSTY 2.10.0 u24.aarch64.pg17 : postgresql-17-pgml postgresql-17-pgml_2.10.0-1PIGSTY~noble_arm64.deb
| PIGSTY 2.10.0 u24.aarch64.pg16 : postgresql-16-pgml postgresql-16-pgml_2.10.0-1PIGSTY~noble_arm64.deb
| PIGSTY 2.10.0 u24.aarch64.pg15 : postgresql-15-pgml postgresql-15-pgml_2.10.0-1PIGSTY~noble_arm64.deb
| PIGSTY 2.10.0 u24.aarch64.pg14 : postgresql-14-pgml postgresql-14-pgml_2.10.0-1PIGSTY~noble_arm64.deb
|
Build
You can build the RPM / DEB packages for pgml using pig build:
pig build pkg pgml # build RPM / DEB packages
Install
You can install pgml directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pgml; # Install for current active PG version
pig ext install -y pgml -v 17 # PG 17
pig ext install -y pgml -v 16 # PG 16
pig ext install -y pgml -v 15 # PG 15
pig ext install -y pgml -v 14 # PG 14
dnf install -y pgml_17 # PG 17
dnf install -y pgml_16 # PG 16
dnf install -y pgml_15 # PG 15
dnf install -y pgml_14 # PG 14
apt install -y postgresql-17-pgml # PG 17
apt install -y postgresql-16-pgml # PG 16
apt install -y postgresql-15-pgml # PG 15
apt install -y postgresql-14-pgml # PG 14
Preload:
shared_preload_libraries = 'pgml';
Create Extension:
CREATE EXTENSION pgml;
Usage
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 string
If 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.8
You are all set! Check PostgresML for more details: https://postgresml.org/docs/guides/use-cases/
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.