plr

plr : load R interpreter and execute R script from within a database

Overview

ID Extension Package Version Category License Language
3100
plr
plr
8.4.8
LANG
GPL-2.0
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d--
No
Yes
No
Yes
no
no
Relationships
See Also
plpgsql
pgml
plpython3u
pg_tle
plv8
pljava
plperl
pllua

missing el10.x86_64

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PGDG
8.4.8
18
17
16
15
14
plr -
RPM
PGDG
8.4.8
18
17
16
15
14
plr_$v -
DEB
PGDG
8.4.8
18
17
16
15
14
postgresql-$v-plr -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
el8.aarch64
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
el9.x86_64
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
el9.aarch64
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
el10.x86_64
MISS
MISS
MISS
MISS
MISS
el10.aarch64
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
PGDG 8.4.8
d12.x86_64
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
d12.aarch64
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
d13.x86_64
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
d13.aarch64
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
u22.x86_64
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
u22.aarch64
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
u24.x86_64
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
u24.aarch64
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
PGDG 8.4.8.3
Package Version OS ORG SIZE File URL
plr_18 8.4.8 el8.x86_64 pgdg 76.1 KiB plr_18-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_18 8.4.8 el8.aarch64 pgdg 73.7 KiB plr_18-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_18 8.4.8 el9.x86_64 pgdg 73.9 KiB plr_18-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_18 8.4.8 el9.aarch64 pgdg 72.1 KiB plr_18-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_18 8.4.8 el10.aarch64 pgdg 73.7 KiB plr_18-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-18-plr 8.4.8.3 d12.x86_64 pgdg 135.9 KiB postgresql-18-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-18-plr 8.4.8.2 d12.x86_64 pgdg 135.8 KiB postgresql-18-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-18-plr 8.4.8.3 d12.aarch64 pgdg 132.3 KiB postgresql-18-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-18-plr 8.4.8.2 d12.aarch64 pgdg 132.2 KiB postgresql-18-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-18-plr 8.4.8.3 d13.x86_64 pgdg 136.1 KiB postgresql-18-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-18-plr 8.4.8.2 d13.x86_64 pgdg 136.1 KiB postgresql-18-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-18-plr 8.4.8.3 d13.aarch64 pgdg 132.6 KiB postgresql-18-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-18-plr 8.4.8.2 d13.aarch64 pgdg 132.7 KiB postgresql-18-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-18-plr 8.4.8.3 u22.x86_64 pgdg 131.6 KiB postgresql-18-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-18-plr 8.4.8.2 u22.x86_64 pgdg 131.4 KiB postgresql-18-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-18-plr 8.4.8.3 u22.aarch64 pgdg 128.4 KiB postgresql-18-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-18-plr 8.4.8.2 u22.aarch64 pgdg 128.3 KiB postgresql-18-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-18-plr 8.4.8.3 u24.x86_64 pgdg 127.1 KiB postgresql-18-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-18-plr 8.4.8.2 u24.x86_64 pgdg 127.2 KiB postgresql-18-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-18-plr 8.4.8.3 u24.aarch64 pgdg 123.7 KiB postgresql-18-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-18-plr 8.4.8.2 u24.aarch64 pgdg 123.6 KiB postgresql-18-plr_8.4.8.2-1.pgdg24.04+1_arm64.deb
Package Version OS ORG SIZE File URL
plr_17 8.4.8 el8.x86_64 pgdg 76.0 KiB plr_17-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_17 8.4.7 el8.x86_64 pgdg 75.7 KiB plr_17-8.4.7-1PGDG.rhel8.x86_64.rpm
plr_17 8.4.8 el8.aarch64 pgdg 73.7 KiB plr_17-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_17 8.4.7 el8.aarch64 pgdg 73.4 KiB plr_17-8.4.7-1PGDG.rhel8.aarch64.rpm
plr_17 8.4.8 el9.x86_64 pgdg 73.8 KiB plr_17-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_17 8.4.7 el9.x86_64 pgdg 73.6 KiB plr_17-8.4.7-1PGDG.rhel9.x86_64.rpm
plr_17 8.4.8 el9.aarch64 pgdg 72.2 KiB plr_17-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_17 8.4.7 el9.aarch64 pgdg 72.0 KiB plr_17-8.4.7-1PGDG.rhel9.aarch64.rpm
plr_17 8.4.8 el10.aarch64 pgdg 73.5 KiB plr_17-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-17-plr 8.4.8.3 d12.x86_64 pgdg 135.7 KiB postgresql-17-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-17-plr 8.4.8.2 d12.x86_64 pgdg 135.6 KiB postgresql-17-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-17-plr 8.4.8.3 d12.aarch64 pgdg 132.1 KiB postgresql-17-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-17-plr 8.4.8.2 d12.aarch64 pgdg 132.0 KiB postgresql-17-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-17-plr 8.4.8.3 d13.x86_64 pgdg 135.9 KiB postgresql-17-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-17-plr 8.4.8.2 d13.x86_64 pgdg 135.7 KiB postgresql-17-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-17-plr 8.4.8.3 d13.aarch64 pgdg 132.5 KiB postgresql-17-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-17-plr 8.4.8.2 d13.aarch64 pgdg 132.4 KiB postgresql-17-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-17-plr 8.4.8.3 u22.x86_64 pgdg 155.6 KiB postgresql-17-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-17-plr 8.4.8.2 u22.x86_64 pgdg 155.5 KiB postgresql-17-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-17-plr 8.4.8.3 u22.aarch64 pgdg 152.2 KiB postgresql-17-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-17-plr 8.4.8.2 u22.aarch64 pgdg 152.1 KiB postgresql-17-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-17-plr 8.4.8.3 u24.x86_64 pgdg 127.1 KiB postgresql-17-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-17-plr 8.4.8.2 u24.x86_64 pgdg 127.2 KiB postgresql-17-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-17-plr 8.4.8.3 u24.aarch64 pgdg 123.4 KiB postgresql-17-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-17-plr 8.4.8.2 u24.aarch64 pgdg 123.4 KiB postgresql-17-plr_8.4.8.2-1.pgdg24.04+1_arm64.deb
Package Version OS ORG SIZE File URL
plr_16 8.4.8 el8.x86_64 pgdg 76.0 KiB plr_16-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_16 8.4.7 el8.x86_64 pgdg 75.7 KiB plr_16-8.4.7-1PGDG.rhel8.x86_64.rpm
plr_16 8.4.6 el8.x86_64 pgdg 74.8 KiB plr_16-8.4.6-1PGDG.rhel8.x86_64.rpm
plr_16 8.4.8 el8.aarch64 pgdg 73.6 KiB plr_16-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_16 8.4.7 el8.aarch64 pgdg 73.4 KiB plr_16-8.4.7-1PGDG.rhel8.aarch64.rpm
plr_16 8.4.6 el8.aarch64 pgdg 72.6 KiB plr_16-8.4.6-1PGDG.rhel8.aarch64.rpm
plr_16 8.4.8 el9.x86_64 pgdg 73.8 KiB plr_16-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_16 8.4.7 el9.x86_64 pgdg 73.6 KiB plr_16-8.4.7-1PGDG.rhel9.x86_64.rpm
plr_16 8.4.6 el9.x86_64 pgdg 72.8 KiB plr_16-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_16 8.4.6 el9.x86_64 pgdg 73.6 KiB plr_16-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_16 8.4.6 el9.x86_64 pgdg 73.6 KiB plr_16-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_16 8.4.8 el9.aarch64 pgdg 72.2 KiB plr_16-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_16 8.4.7 el9.aarch64 pgdg 72.0 KiB plr_16-8.4.7-1PGDG.rhel9.aarch64.rpm
plr_16 8.4.6 el9.aarch64 pgdg 71.1 KiB plr_16-8.4.6-1PGDG.rhel9.aarch64.rpm
plr_16 8.4.8 el10.aarch64 pgdg 73.5 KiB plr_16-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-16-plr 8.4.8.3 d12.x86_64 pgdg 135.6 KiB postgresql-16-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-16-plr 8.4.8.2 d12.x86_64 pgdg 135.6 KiB postgresql-16-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-16-plr 8.4.8.3 d12.aarch64 pgdg 132.0 KiB postgresql-16-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-16-plr 8.4.8.2 d12.aarch64 pgdg 132.0 KiB postgresql-16-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-16-plr 8.4.8.3 d13.x86_64 pgdg 135.8 KiB postgresql-16-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-16-plr 8.4.8.2 d13.x86_64 pgdg 135.8 KiB postgresql-16-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-16-plr 8.4.8.3 d13.aarch64 pgdg 132.6 KiB postgresql-16-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-16-plr 8.4.8.2 d13.aarch64 pgdg 132.4 KiB postgresql-16-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-16-plr 8.4.8.3 u22.x86_64 pgdg 151.7 KiB postgresql-16-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-16-plr 8.4.8.2 u22.x86_64 pgdg 151.6 KiB postgresql-16-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-16-plr 8.4.8.3 u22.aarch64 pgdg 148.1 KiB postgresql-16-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-16-plr 8.4.8.2 u22.aarch64 pgdg 148.2 KiB postgresql-16-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-16-plr 8.4.8.3 u24.x86_64 pgdg 127.1 KiB postgresql-16-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-16-plr 8.4.8.2 u24.x86_64 pgdg 127.1 KiB postgresql-16-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-16-plr 8.4.8.3 u24.aarch64 pgdg 123.4 KiB postgresql-16-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-16-plr 8.4.8.2 u24.aarch64 pgdg 123.4 KiB postgresql-16-plr_8.4.8.2-1.pgdg24.04+1_arm64.deb
Package Version OS ORG SIZE File URL
plr_15 8.4.8 el8.x86_64 pgdg 76.5 KiB plr_15-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_15 8.4.7 el8.x86_64 pgdg 76.2 KiB plr_15-8.4.7-1PGDG.rhel8.x86_64.rpm
plr_15 8.4.6 el8.x86_64 pgdg 75.4 KiB plr_15-8.4.6-1PGDG.rhel8.x86_64.rpm
plr_15 8.4.5 el8.x86_64 pgdg 167.4 KiB plr_15-8.4.5-1.rhel8.x86_64.rpm
plr_15 8.4.8 el8.aarch64 pgdg 74.1 KiB plr_15-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_15 8.4.7 el8.aarch64 pgdg 73.9 KiB plr_15-8.4.7-1PGDG.rhel8.aarch64.rpm
plr_15 8.4.6 el8.aarch64 pgdg 73.1 KiB plr_15-8.4.6-1PGDG.rhel8.aarch64.rpm
plr_15 8.4.8 el9.x86_64 pgdg 74.5 KiB plr_15-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_15 8.4.7 el9.x86_64 pgdg 74.4 KiB plr_15-8.4.7-1PGDG.rhel9.x86_64.rpm
plr_15 8.4.6 el9.x86_64 pgdg 73.6 KiB plr_15-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_15 8.4.5 el9.x86_64 pgdg 167.8 KiB plr_15-8.4.5-1.rhel9.x86_64.rpm
plr_15 8.4.8 el9.aarch64 pgdg 72.8 KiB plr_15-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_15 8.4.7 el9.aarch64 pgdg 72.6 KiB plr_15-8.4.7-1PGDG.rhel9.aarch64.rpm
plr_15 8.4.6 el9.aarch64 pgdg 71.7 KiB plr_15-8.4.6-1PGDG.rhel9.aarch64.rpm
plr_15 8.4.8 el10.aarch64 pgdg 74.1 KiB plr_15-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-15-plr 8.4.8.3 d12.x86_64 pgdg 136.3 KiB postgresql-15-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-15-plr 8.4.8.2 d12.x86_64 pgdg 136.1 KiB postgresql-15-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-15-plr 8.4.8.3 d12.aarch64 pgdg 132.5 KiB postgresql-15-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-15-plr 8.4.8.2 d12.aarch64 pgdg 132.4 KiB postgresql-15-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-15-plr 8.4.8.3 d13.x86_64 pgdg 136.4 KiB postgresql-15-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-15-plr 8.4.8.2 d13.x86_64 pgdg 136.1 KiB postgresql-15-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-15-plr 8.4.8.3 d13.aarch64 pgdg 132.9 KiB postgresql-15-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-15-plr 8.4.8.2 d13.aarch64 pgdg 132.7 KiB postgresql-15-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-15-plr 8.4.8.3 u22.x86_64 pgdg 151.4 KiB postgresql-15-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-15-plr 8.4.8.2 u22.x86_64 pgdg 151.3 KiB postgresql-15-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-15-plr 8.4.8.3 u22.aarch64 pgdg 148.3 KiB postgresql-15-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-15-plr 8.4.8.2 u22.aarch64 pgdg 148.0 KiB postgresql-15-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-15-plr 8.4.8.3 u24.x86_64 pgdg 127.4 KiB postgresql-15-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-15-plr 8.4.8.2 u24.x86_64 pgdg 127.3 KiB postgresql-15-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-15-plr 8.4.8.3 u24.aarch64 pgdg 123.7 KiB postgresql-15-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-15-plr 8.4.8.2 u24.aarch64 pgdg 123.6 KiB postgresql-15-plr_8.4.8.2-1.pgdg24.04+1_arm64.deb
Package Version OS ORG SIZE File URL
plr_14 8.4.8 el8.x86_64 pgdg 76.5 KiB plr_14-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_14 8.4.7 el8.x86_64 pgdg 76.2 KiB plr_14-8.4.7-1PGDG.rhel8.x86_64.rpm
plr_14 8.4.6 el8.x86_64 pgdg 75.4 KiB plr_14-8.4.6-1PGDG.rhel8.x86_64.rpm
plr_14 8.4.5 el8.x86_64 pgdg 166.7 KiB plr_14-8.4.5-1.rhel8.x86_64.rpm
plr_14 8.4.3 el8.x86_64 pgdg 166.5 KiB plr_14-8.4.3-1.rhel8.x86_64.rpm
plr_14 8.4.8 el8.aarch64 pgdg 74.1 KiB plr_14-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_14 8.4.7 el8.aarch64 pgdg 73.9 KiB plr_14-8.4.7-1PGDG.rhel8.aarch64.rpm
plr_14 8.4.6 el8.aarch64 pgdg 73.1 KiB plr_14-8.4.6-1PGDG.rhel8.aarch64.rpm
plr_14 8.4.8 el9.x86_64 pgdg 74.5 KiB plr_14-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_14 8.4.7 el9.x86_64 pgdg 74.3 KiB plr_14-8.4.7-1PGDG.rhel9.x86_64.rpm
plr_14 8.4.6 el9.x86_64 pgdg 73.6 KiB plr_14-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_14 8.4.5 el9.x86_64 pgdg 167.4 KiB plr_14-8.4.5-1.rhel9.x86_64.rpm
plr_14 8.4.8 el9.aarch64 pgdg 72.8 KiB plr_14-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_14 8.4.7 el9.aarch64 pgdg 72.6 KiB plr_14-8.4.7-1PGDG.rhel9.aarch64.rpm
plr_14 8.4.6 el9.aarch64 pgdg 71.7 KiB plr_14-8.4.6-1PGDG.rhel9.aarch64.rpm
plr_14 8.4.8 el10.aarch64 pgdg 74.1 KiB plr_14-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-14-plr 8.4.8.3 d12.x86_64 pgdg 136.1 KiB postgresql-14-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-14-plr 8.4.8.2 d12.x86_64 pgdg 136.1 KiB postgresql-14-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-14-plr 8.4.8.3 d12.aarch64 pgdg 132.4 KiB postgresql-14-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-14-plr 8.4.8.2 d12.aarch64 pgdg 132.4 KiB postgresql-14-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-14-plr 8.4.8.3 d13.x86_64 pgdg 136.2 KiB postgresql-14-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-14-plr 8.4.8.2 d13.x86_64 pgdg 136.2 KiB postgresql-14-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-14-plr 8.4.8.3 d13.aarch64 pgdg 132.9 KiB postgresql-14-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-14-plr 8.4.8.2 d13.aarch64 pgdg 132.8 KiB postgresql-14-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-14-plr 8.4.8.3 u22.x86_64 pgdg 151.4 KiB postgresql-14-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-14-plr 8.4.8.2 u22.x86_64 pgdg 151.4 KiB postgresql-14-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-14-plr 8.4.8.3 u22.aarch64 pgdg 148.3 KiB postgresql-14-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-14-plr 8.4.8.2 u22.aarch64 pgdg 148.3 KiB postgresql-14-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-14-plr 8.4.8.3 u24.x86_64 pgdg 127.4 KiB postgresql-14-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-14-plr 8.4.8.2 u24.x86_64 pgdg 127.3 KiB postgresql-14-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-14-plr 8.4.8.3 u24.aarch64 pgdg 123.7 KiB postgresql-14-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-14-plr 8.4.8.2 u24.aarch64 pgdg 123.7 KiB postgresql-14-plr_8.4.8.2-1.pgdg24.04+1_arm64.deb

Source

Install

Make sure PGDG repo available:

pig repo add pgdg -u    # add pgdg repo and update cache

Install this extension with pig:

pig install plr;		# install via package name, for the active PG version

pig install plr -v 18;   # install for PG 18
pig install plr -v 17;   # install for PG 17
pig install plr -v 16;   # install for PG 16
pig install plr -v 15;   # install for PG 15
pig install plr -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION plr;

Usage

plr: load R interpreter and execute R script from within a database

plr enables writing PostgreSQL functions in the R programming language, providing full access to R’s statistical and data analysis capabilities.

CREATE EXTENSION plr;

Create Functions

CREATE OR REPLACE FUNCTION r_max(integer, integer) RETURNS integer AS '
if (arg1 > arg2)
  return(arg1)
else
  return(arg2)
' LANGUAGE plr STRICT;

SELECT r_max(10, 20);  -- 20

With named arguments:

CREATE OR REPLACE FUNCTION sd(vals float8[]) RETURNS float AS '
sd(vals)
' LANGUAGE plr STRICT;

SELECT sd(ARRAY[1.0, 2.0, 3.0, 4.0, 5.0]);

Argument Handling

  • Arguments are available as arg1, arg2, … or by named parameter
  • NULL arguments become R NA values (unless function is STRICT)
  • Composite types (rows) are passed as R data.frames
  • Arrays are passed as R vectors
CREATE OR REPLACE FUNCTION r_max(integer, integer) RETURNS integer AS '
if (is.null(arg1) && is.null(arg2))
  return(NULL)
if (is.null(arg1))
  return(arg2)
if (is.null(arg2))
  return(arg1)
if (arg1 > arg2)
  return(arg1)
return(arg2)
' LANGUAGE plr;

Database Access via SPI

CREATE OR REPLACE FUNCTION test_spi(text) RETURNS SETOF record AS '
pg.spi.exec(arg1)
' LANGUAGE plr;

SELECT * FROM test_spi('SELECT oid, typname FROM pg_type LIMIT 5')
  AS t(oid oid, typname name);

Prepared statements:

-- Prepare
sp <<- pg.spi.prepare('SELECT * FROM pg_type WHERE typname = $1', c(NAMEOID))
-- Execute
pg.spi.execp(sp, list('text'))

Set-Returning Functions

Return a data.frame for set-returning functions:

CREATE OR REPLACE FUNCTION get_numbers(n int) RETURNS SETOF integer AS '
1:arg1
' LANGUAGE plr;

SELECT * FROM get_numbers(5);

Window Functions

CREATE OR REPLACE FUNCTION r_regr_slope(float8, float8, int)
RETURNS float8 AS '
slope <- NA
y <- farg1
x <- farg2
if (fnumrows == arg3 + 1L)
  try(slope <- lm(y ~ x)$coefficients[2])
return(slope)
' LANGUAGE plr WINDOW;

Window functions receive farg1..fargN (vectors of values in the window frame), fnumrows (frame size), and prownum (current row position in partition).

Global Variables

Persist data across function calls using R’s global environment:

CREATE OR REPLACE FUNCTION set_state(key text, val text) RETURNS void AS '
assign(arg1, arg2, env=.GlobalEnv)
' LANGUAGE plr;

Useful Support Functions

SELECT load_r_typenames();  -- Load type OID variables
SELECT * FROM r_typenames(); -- List available type OIDs
SELECT plr_version();        -- PL/R version

Trigger Functions

PL/R supports trigger functions with access to pg.tg.name, pg.tg.relname, pg.tg.when, pg.tg.level, pg.tg.op, pg.tg.new, and pg.tg.old.

Last updated on