plr

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

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
3100
plr
plr
8.4.8
LANG
GPL-2.0
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--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

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
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 / PGPG18PG17PG16PG15PG14
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
PackageVersionOSORGSIZEFile URL
plr_188.4.8el8.x86_64pgdg76.1 KiBplr_18-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_188.4.8el8.aarch64pgdg73.7 KiBplr_18-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_188.4.8el9.x86_64pgdg73.9 KiBplr_18-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_188.4.8el9.aarch64pgdg72.1 KiBplr_18-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_188.4.8el10.aarch64pgdg73.7 KiBplr_18-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-18-plr8.4.8.3d12.x86_64pgdg135.9 KiBpostgresql-18-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-18-plr8.4.8.2d12.x86_64pgdg135.8 KiBpostgresql-18-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-18-plr8.4.8.3d12.aarch64pgdg132.3 KiBpostgresql-18-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-18-plr8.4.8.2d12.aarch64pgdg132.2 KiBpostgresql-18-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-18-plr8.4.8.3d13.x86_64pgdg136.1 KiBpostgresql-18-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-18-plr8.4.8.2d13.x86_64pgdg136.1 KiBpostgresql-18-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-18-plr8.4.8.3d13.aarch64pgdg132.6 KiBpostgresql-18-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-18-plr8.4.8.2d13.aarch64pgdg132.7 KiBpostgresql-18-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-18-plr8.4.8.3u22.x86_64pgdg131.6 KiBpostgresql-18-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-18-plr8.4.8.2u22.x86_64pgdg131.4 KiBpostgresql-18-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-18-plr8.4.8.3u22.aarch64pgdg128.4 KiBpostgresql-18-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-18-plr8.4.8.2u22.aarch64pgdg128.3 KiBpostgresql-18-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-18-plr8.4.8.3u24.x86_64pgdg127.1 KiBpostgresql-18-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-18-plr8.4.8.2u24.x86_64pgdg127.2 KiBpostgresql-18-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-18-plr8.4.8.3u24.aarch64pgdg123.7 KiBpostgresql-18-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-18-plr8.4.8.2u24.aarch64pgdg123.6 KiBpostgresql-18-plr_8.4.8.2-1.pgdg24.04+1_arm64.deb
PackageVersionOSORGSIZEFile URL
plr_178.4.8el8.x86_64pgdg76.0 KiBplr_17-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_178.4.7el8.x86_64pgdg75.7 KiBplr_17-8.4.7-1PGDG.rhel8.x86_64.rpm
plr_178.4.8el8.aarch64pgdg73.7 KiBplr_17-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_178.4.7el8.aarch64pgdg73.4 KiBplr_17-8.4.7-1PGDG.rhel8.aarch64.rpm
plr_178.4.8el9.x86_64pgdg73.8 KiBplr_17-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_178.4.7el9.x86_64pgdg73.6 KiBplr_17-8.4.7-1PGDG.rhel9.x86_64.rpm
plr_178.4.8el9.aarch64pgdg72.2 KiBplr_17-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_178.4.7el9.aarch64pgdg72.0 KiBplr_17-8.4.7-1PGDG.rhel9.aarch64.rpm
plr_178.4.8el10.aarch64pgdg73.5 KiBplr_17-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-17-plr8.4.8.3d12.x86_64pgdg135.7 KiBpostgresql-17-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-17-plr8.4.8.2d12.x86_64pgdg135.6 KiBpostgresql-17-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-17-plr8.4.8.3d12.aarch64pgdg132.1 KiBpostgresql-17-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-17-plr8.4.8.2d12.aarch64pgdg132.0 KiBpostgresql-17-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-17-plr8.4.8.3d13.x86_64pgdg135.9 KiBpostgresql-17-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-17-plr8.4.8.2d13.x86_64pgdg135.7 KiBpostgresql-17-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-17-plr8.4.8.3d13.aarch64pgdg132.5 KiBpostgresql-17-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-17-plr8.4.8.2d13.aarch64pgdg132.4 KiBpostgresql-17-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-17-plr8.4.8.3u22.x86_64pgdg155.6 KiBpostgresql-17-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-17-plr8.4.8.2u22.x86_64pgdg155.5 KiBpostgresql-17-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-17-plr8.4.8.3u22.aarch64pgdg152.2 KiBpostgresql-17-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-17-plr8.4.8.2u22.aarch64pgdg152.1 KiBpostgresql-17-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-17-plr8.4.8.3u24.x86_64pgdg127.1 KiBpostgresql-17-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-17-plr8.4.8.2u24.x86_64pgdg127.2 KiBpostgresql-17-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-17-plr8.4.8.3u24.aarch64pgdg123.4 KiBpostgresql-17-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-17-plr8.4.8.2u24.aarch64pgdg123.4 KiBpostgresql-17-plr_8.4.8.2-1.pgdg24.04+1_arm64.deb
PackageVersionOSORGSIZEFile URL
plr_168.4.8el8.x86_64pgdg76.0 KiBplr_16-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_168.4.7el8.x86_64pgdg75.7 KiBplr_16-8.4.7-1PGDG.rhel8.x86_64.rpm
plr_168.4.6el8.x86_64pgdg74.8 KiBplr_16-8.4.6-1PGDG.rhel8.x86_64.rpm
plr_168.4.8el8.aarch64pgdg73.6 KiBplr_16-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_168.4.7el8.aarch64pgdg73.4 KiBplr_16-8.4.7-1PGDG.rhel8.aarch64.rpm
plr_168.4.6el8.aarch64pgdg72.6 KiBplr_16-8.4.6-1PGDG.rhel8.aarch64.rpm
plr_168.4.8el9.x86_64pgdg73.8 KiBplr_16-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_168.4.7el9.x86_64pgdg73.6 KiBplr_16-8.4.7-1PGDG.rhel9.x86_64.rpm
plr_168.4.6el9.x86_64pgdg72.8 KiBplr_16-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_168.4.6el9.x86_64pgdg73.6 KiBplr_16-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_168.4.6el9.x86_64pgdg73.6 KiBplr_16-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_168.4.8el9.aarch64pgdg72.2 KiBplr_16-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_168.4.7el9.aarch64pgdg72.0 KiBplr_16-8.4.7-1PGDG.rhel9.aarch64.rpm
plr_168.4.6el9.aarch64pgdg71.1 KiBplr_16-8.4.6-1PGDG.rhel9.aarch64.rpm
plr_168.4.8el10.aarch64pgdg73.5 KiBplr_16-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-16-plr8.4.8.3d12.x86_64pgdg135.6 KiBpostgresql-16-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-16-plr8.4.8.2d12.x86_64pgdg135.6 KiBpostgresql-16-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-16-plr8.4.8.3d12.aarch64pgdg132.0 KiBpostgresql-16-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-16-plr8.4.8.2d12.aarch64pgdg132.0 KiBpostgresql-16-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-16-plr8.4.8.3d13.x86_64pgdg135.8 KiBpostgresql-16-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-16-plr8.4.8.2d13.x86_64pgdg135.8 KiBpostgresql-16-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-16-plr8.4.8.3d13.aarch64pgdg132.6 KiBpostgresql-16-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-16-plr8.4.8.2d13.aarch64pgdg132.4 KiBpostgresql-16-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-16-plr8.4.8.3u22.x86_64pgdg151.7 KiBpostgresql-16-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-16-plr8.4.8.2u22.x86_64pgdg151.6 KiBpostgresql-16-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-16-plr8.4.8.3u22.aarch64pgdg148.1 KiBpostgresql-16-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-16-plr8.4.8.2u22.aarch64pgdg148.2 KiBpostgresql-16-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-16-plr8.4.8.3u24.x86_64pgdg127.1 KiBpostgresql-16-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-16-plr8.4.8.2u24.x86_64pgdg127.1 KiBpostgresql-16-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-16-plr8.4.8.3u24.aarch64pgdg123.4 KiBpostgresql-16-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-16-plr8.4.8.2u24.aarch64pgdg123.4 KiBpostgresql-16-plr_8.4.8.2-1.pgdg24.04+1_arm64.deb
PackageVersionOSORGSIZEFile URL
plr_158.4.8el8.x86_64pgdg76.5 KiBplr_15-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_158.4.7el8.x86_64pgdg76.2 KiBplr_15-8.4.7-1PGDG.rhel8.x86_64.rpm
plr_158.4.6el8.x86_64pgdg75.4 KiBplr_15-8.4.6-1PGDG.rhel8.x86_64.rpm
plr_158.4.5el8.x86_64pgdg167.4 KiBplr_15-8.4.5-1.rhel8.x86_64.rpm
plr_158.4.8el8.aarch64pgdg74.1 KiBplr_15-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_158.4.7el8.aarch64pgdg73.9 KiBplr_15-8.4.7-1PGDG.rhel8.aarch64.rpm
plr_158.4.6el8.aarch64pgdg73.1 KiBplr_15-8.4.6-1PGDG.rhel8.aarch64.rpm
plr_158.4.8el9.x86_64pgdg74.5 KiBplr_15-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_158.4.7el9.x86_64pgdg74.4 KiBplr_15-8.4.7-1PGDG.rhel9.x86_64.rpm
plr_158.4.6el9.x86_64pgdg73.6 KiBplr_15-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_158.4.5el9.x86_64pgdg167.8 KiBplr_15-8.4.5-1.rhel9.x86_64.rpm
plr_158.4.8el9.aarch64pgdg72.8 KiBplr_15-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_158.4.7el9.aarch64pgdg72.6 KiBplr_15-8.4.7-1PGDG.rhel9.aarch64.rpm
plr_158.4.6el9.aarch64pgdg71.7 KiBplr_15-8.4.6-1PGDG.rhel9.aarch64.rpm
plr_158.4.8el10.aarch64pgdg74.1 KiBplr_15-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-15-plr8.4.8.3d12.x86_64pgdg136.3 KiBpostgresql-15-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-15-plr8.4.8.2d12.x86_64pgdg136.1 KiBpostgresql-15-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-15-plr8.4.8.3d12.aarch64pgdg132.5 KiBpostgresql-15-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-15-plr8.4.8.2d12.aarch64pgdg132.4 KiBpostgresql-15-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-15-plr8.4.8.3d13.x86_64pgdg136.4 KiBpostgresql-15-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-15-plr8.4.8.2d13.x86_64pgdg136.1 KiBpostgresql-15-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-15-plr8.4.8.3d13.aarch64pgdg132.9 KiBpostgresql-15-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-15-plr8.4.8.2d13.aarch64pgdg132.7 KiBpostgresql-15-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-15-plr8.4.8.3u22.x86_64pgdg151.4 KiBpostgresql-15-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-15-plr8.4.8.2u22.x86_64pgdg151.3 KiBpostgresql-15-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-15-plr8.4.8.3u22.aarch64pgdg148.3 KiBpostgresql-15-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-15-plr8.4.8.2u22.aarch64pgdg148.0 KiBpostgresql-15-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-15-plr8.4.8.3u24.x86_64pgdg127.4 KiBpostgresql-15-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-15-plr8.4.8.2u24.x86_64pgdg127.3 KiBpostgresql-15-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-15-plr8.4.8.3u24.aarch64pgdg123.7 KiBpostgresql-15-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-15-plr8.4.8.2u24.aarch64pgdg123.6 KiBpostgresql-15-plr_8.4.8.2-1.pgdg24.04+1_arm64.deb
PackageVersionOSORGSIZEFile URL
plr_148.4.8el8.x86_64pgdg76.5 KiBplr_14-8.4.8-1PGDG.rhel8.x86_64.rpm
plr_148.4.7el8.x86_64pgdg76.2 KiBplr_14-8.4.7-1PGDG.rhel8.x86_64.rpm
plr_148.4.6el8.x86_64pgdg75.4 KiBplr_14-8.4.6-1PGDG.rhel8.x86_64.rpm
plr_148.4.5el8.x86_64pgdg166.7 KiBplr_14-8.4.5-1.rhel8.x86_64.rpm
plr_148.4.3el8.x86_64pgdg166.5 KiBplr_14-8.4.3-1.rhel8.x86_64.rpm
plr_148.4.8el8.aarch64pgdg74.1 KiBplr_14-8.4.8-1PGDG.rhel8.aarch64.rpm
plr_148.4.7el8.aarch64pgdg73.9 KiBplr_14-8.4.7-1PGDG.rhel8.aarch64.rpm
plr_148.4.6el8.aarch64pgdg73.1 KiBplr_14-8.4.6-1PGDG.rhel8.aarch64.rpm
plr_148.4.8el9.x86_64pgdg74.5 KiBplr_14-8.4.8-1PGDG.rhel9.x86_64.rpm
plr_148.4.7el9.x86_64pgdg74.3 KiBplr_14-8.4.7-1PGDG.rhel9.x86_64.rpm
plr_148.4.6el9.x86_64pgdg73.6 KiBplr_14-8.4.6-1PGDG.rhel9.x86_64.rpm
plr_148.4.5el9.x86_64pgdg167.4 KiBplr_14-8.4.5-1.rhel9.x86_64.rpm
plr_148.4.8el9.aarch64pgdg72.8 KiBplr_14-8.4.8-1PGDG.rhel9.aarch64.rpm
plr_148.4.7el9.aarch64pgdg72.6 KiBplr_14-8.4.7-1PGDG.rhel9.aarch64.rpm
plr_148.4.6el9.aarch64pgdg71.7 KiBplr_14-8.4.6-1PGDG.rhel9.aarch64.rpm
plr_148.4.8el10.aarch64pgdg74.1 KiBplr_14-8.4.8-1PGDG.rhel10.aarch64.rpm
postgresql-14-plr8.4.8.3d12.x86_64pgdg136.1 KiBpostgresql-14-plr_8.4.8.3-1.pgdg12+1_amd64.deb
postgresql-14-plr8.4.8.2d12.x86_64pgdg136.1 KiBpostgresql-14-plr_8.4.8.2-1.pgdg12+1_amd64.deb
postgresql-14-plr8.4.8.3d12.aarch64pgdg132.4 KiBpostgresql-14-plr_8.4.8.3-1.pgdg12+1_arm64.deb
postgresql-14-plr8.4.8.2d12.aarch64pgdg132.4 KiBpostgresql-14-plr_8.4.8.2-1.pgdg12+1_arm64.deb
postgresql-14-plr8.4.8.3d13.x86_64pgdg136.2 KiBpostgresql-14-plr_8.4.8.3-1.pgdg13+1_amd64.deb
postgresql-14-plr8.4.8.2d13.x86_64pgdg136.2 KiBpostgresql-14-plr_8.4.8.2-1.pgdg13+1_amd64.deb
postgresql-14-plr8.4.8.3d13.aarch64pgdg132.9 KiBpostgresql-14-plr_8.4.8.3-1.pgdg13+1_arm64.deb
postgresql-14-plr8.4.8.2d13.aarch64pgdg132.8 KiBpostgresql-14-plr_8.4.8.2-1.pgdg13+1_arm64.deb
postgresql-14-plr8.4.8.3u22.x86_64pgdg151.4 KiBpostgresql-14-plr_8.4.8.3-1.pgdg22.04+1_amd64.deb
postgresql-14-plr8.4.8.2u22.x86_64pgdg151.4 KiBpostgresql-14-plr_8.4.8.2-1.pgdg22.04+1_amd64.deb
postgresql-14-plr8.4.8.3u22.aarch64pgdg148.3 KiBpostgresql-14-plr_8.4.8.3-1.pgdg22.04+1_arm64.deb
postgresql-14-plr8.4.8.2u22.aarch64pgdg148.3 KiBpostgresql-14-plr_8.4.8.2-1.pgdg22.04+1_arm64.deb
postgresql-14-plr8.4.8.3u24.x86_64pgdg127.4 KiBpostgresql-14-plr_8.4.8.3-1.pgdg24.04+1_amd64.deb
postgresql-14-plr8.4.8.2u24.x86_64pgdg127.3 KiBpostgresql-14-plr_8.4.8.2-1.pgdg24.04+1_amd64.deb
postgresql-14-plr8.4.8.3u24.aarch64pgdg123.7 KiBpostgresql-14-plr_8.4.8.3-1.pgdg24.04+1_arm64.deb
postgresql-14-plr8.4.8.2u24.aarch64pgdg123.7 KiBpostgresql-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