Skip to content

quantile

Quantile aggregation function

quantile · Quantile aggregation function

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4610quantilequantile1.1.8FUNCBSD-2-ClauseC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.1.819 18 17 16 15quantile-
RPMPIGSTY1.1.819 18 17 16 15quantile_$v-
DEBPIGSTY1.1.819 18 17 16 15postgresql-$v-quantile-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
el8.aarch64N/APIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
el9.x86_64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
el9.aarch64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
el10.x86_64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
el10.aarch64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
d12.x86_64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
d12.aarch64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
d13.x86_64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
d13.aarch64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
u22.x86_64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
u22.aarch64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
u24.x86_64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
u24.aarch64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
u26.x86_64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
u26.aarch64PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8PIGSTY 1.1.8
PackageVersionOSORGSIZEFile URL
quantile_191.1.8el9.x86_64pigsty30.0 KiBquantile_19-1.1.8-1PGSTY.el9.x86_64.rpm
quantile_191.1.8el9.aarch64pigsty29.3 KiBquantile_19-1.1.8-1PGSTY.el9.aarch64.rpm
quantile_191.1.8el10.x86_64pigsty30.2 KiBquantile_19-1.1.8-1PGSTY.el10.x86_64.rpm
quantile_191.1.8el10.aarch64pigsty29.8 KiBquantile_19-1.1.8-1PGSTY.el10.aarch64.rpm
postgresql-19-quantile1.1.8d12.x86_64pigsty21.6 KiBpostgresql-19-quantile_1.1.8-1PGSTY~bookworm_amd64.deb
postgresql-19-quantile1.1.8d12.aarch64pigsty21.3 KiBpostgresql-19-quantile_1.1.8-1PGSTY~bookworm_arm64.deb
postgresql-19-quantile1.1.8d13.x86_64pigsty21.6 KiBpostgresql-19-quantile_1.1.8-1PGSTY~trixie_amd64.deb
postgresql-19-quantile1.1.8d13.aarch64pigsty21.4 KiBpostgresql-19-quantile_1.1.8-1PGSTY~trixie_arm64.deb
postgresql-19-quantile1.1.8u22.x86_64pigsty22.8 KiBpostgresql-19-quantile_1.1.8-1PGSTY~jammy_amd64.deb
postgresql-19-quantile1.1.8u22.aarch64pigsty21.9 KiBpostgresql-19-quantile_1.1.8-1PGSTY~jammy_arm64.deb
postgresql-19-quantile1.1.8u24.x86_64pigsty22.6 KiBpostgresql-19-quantile_1.1.8-1PGSTY~noble_amd64.deb
postgresql-19-quantile1.1.8u24.aarch64pigsty22.3 KiBpostgresql-19-quantile_1.1.8-1PGSTY~noble_arm64.deb
postgresql-19-quantile1.1.8u26.x86_64pigsty22.6 KiBpostgresql-19-quantile_1.1.8-1PGSTY~resolute_amd64.deb
postgresql-19-quantile1.1.8u26.aarch64pigsty22.3 KiBpostgresql-19-quantile_1.1.8-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
quantile_181.1.8el8.x86_64pigsty29.6 KiBquantile_18-1.1.8-1PGSTY.el8.x86_64.rpm
quantile_181.1.8el8.aarch64pigsty28.9 KiBquantile_18-1.1.8-1PGSTY.el8.aarch64.rpm
quantile_181.1.8el9.x86_64pigsty30.0 KiBquantile_18-1.1.8-1PGSTY.el9.x86_64.rpm
quantile_181.1.8el9.aarch64pigsty29.3 KiBquantile_18-1.1.8-1PGSTY.el9.aarch64.rpm
quantile_181.1.8el10.x86_64pigsty30.2 KiBquantile_18-1.1.8-1PGSTY.el10.x86_64.rpm
quantile_181.1.8el10.aarch64pigsty29.8 KiBquantile_18-1.1.8-1PGSTY.el10.aarch64.rpm
postgresql-18-quantile1.1.8d12.x86_64pigsty21.6 KiBpostgresql-18-quantile_1.1.8-1PGSTY~bookworm_amd64.deb
postgresql-18-quantile1.1.8d12.aarch64pigsty21.3 KiBpostgresql-18-quantile_1.1.8-1PGSTY~bookworm_arm64.deb
postgresql-18-quantile1.1.8d13.x86_64pigsty21.6 KiBpostgresql-18-quantile_1.1.8-1PGSTY~trixie_amd64.deb
postgresql-18-quantile1.1.8d13.aarch64pigsty21.4 KiBpostgresql-18-quantile_1.1.8-1PGSTY~trixie_arm64.deb
postgresql-18-quantile1.1.8u22.x86_64pigsty22.8 KiBpostgresql-18-quantile_1.1.8-1PGSTY~jammy_amd64.deb
postgresql-18-quantile1.1.8u22.aarch64pigsty21.9 KiBpostgresql-18-quantile_1.1.8-1PGSTY~jammy_arm64.deb
postgresql-18-quantile1.1.8u24.x86_64pigsty22.6 KiBpostgresql-18-quantile_1.1.8-1PGSTY~noble_amd64.deb
postgresql-18-quantile1.1.8u24.aarch64pigsty22.3 KiBpostgresql-18-quantile_1.1.8-1PGSTY~noble_arm64.deb
postgresql-18-quantile1.1.8u26.x86_64pigsty22.6 KiBpostgresql-18-quantile_1.1.8-1PGSTY~resolute_amd64.deb
postgresql-18-quantile1.1.8u26.aarch64pigsty22.3 KiBpostgresql-18-quantile_1.1.8-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
quantile_171.1.8el8.x86_64pigsty29.5 KiBquantile_17-1.1.8-1PGSTY.el8.x86_64.rpm
quantile_171.1.8el8.aarch64pigsty28.9 KiBquantile_17-1.1.8-1PGSTY.el8.aarch64.rpm
quantile_171.1.8el9.x86_64pigsty30.0 KiBquantile_17-1.1.8-1PGSTY.el9.x86_64.rpm
quantile_171.1.8el9.aarch64pigsty29.3 KiBquantile_17-1.1.8-1PGSTY.el9.aarch64.rpm
quantile_171.1.8el10.x86_64pigsty30.1 KiBquantile_17-1.1.8-1PGSTY.el10.x86_64.rpm
quantile_171.1.8el10.aarch64pigsty29.7 KiBquantile_17-1.1.8-1PGSTY.el10.aarch64.rpm
postgresql-17-quantile1.1.8d12.x86_64pigsty21.3 KiBpostgresql-17-quantile_1.1.8-1PGSTY~bookworm_amd64.deb
postgresql-17-quantile1.1.8d12.aarch64pigsty21.0 KiBpostgresql-17-quantile_1.1.8-1PGSTY~bookworm_arm64.deb
postgresql-17-quantile1.1.8d13.x86_64pigsty21.3 KiBpostgresql-17-quantile_1.1.8-1PGSTY~trixie_amd64.deb
postgresql-17-quantile1.1.8d13.aarch64pigsty21.1 KiBpostgresql-17-quantile_1.1.8-1PGSTY~trixie_arm64.deb
postgresql-17-quantile1.1.8u22.x86_64pigsty24.0 KiBpostgresql-17-quantile_1.1.8-1PGSTY~jammy_amd64.deb
postgresql-17-quantile1.1.8u22.aarch64pigsty23.1 KiBpostgresql-17-quantile_1.1.8-1PGSTY~jammy_arm64.deb
postgresql-17-quantile1.1.8u24.x86_64pigsty22.4 KiBpostgresql-17-quantile_1.1.8-1PGSTY~noble_amd64.deb
postgresql-17-quantile1.1.8u24.aarch64pigsty22.1 KiBpostgresql-17-quantile_1.1.8-1PGSTY~noble_arm64.deb
postgresql-17-quantile1.1.8u26.x86_64pigsty22.5 KiBpostgresql-17-quantile_1.1.8-1PGSTY~resolute_amd64.deb
postgresql-17-quantile1.1.8u26.aarch64pigsty22.1 KiBpostgresql-17-quantile_1.1.8-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
quantile_161.1.8el8.x86_64pigsty29.5 KiBquantile_16-1.1.8-1PGSTY.el8.x86_64.rpm
quantile_161.1.8el8.aarch64pigsty28.8 KiBquantile_16-1.1.8-1PGSTY.el8.aarch64.rpm
quantile_161.1.8el9.x86_64pigsty29.9 KiBquantile_16-1.1.8-1PGSTY.el9.x86_64.rpm
quantile_161.1.8el9.aarch64pigsty29.2 KiBquantile_16-1.1.8-1PGSTY.el9.aarch64.rpm
quantile_161.1.8el10.x86_64pigsty30.0 KiBquantile_16-1.1.8-1PGSTY.el10.x86_64.rpm
quantile_161.1.8el10.aarch64pigsty29.6 KiBquantile_16-1.1.8-1PGSTY.el10.aarch64.rpm
postgresql-16-quantile1.1.8d12.x86_64pigsty21.3 KiBpostgresql-16-quantile_1.1.8-1PGSTY~bookworm_amd64.deb
postgresql-16-quantile1.1.8d12.aarch64pigsty21.0 KiBpostgresql-16-quantile_1.1.8-1PGSTY~bookworm_arm64.deb
postgresql-16-quantile1.1.8d13.x86_64pigsty21.3 KiBpostgresql-16-quantile_1.1.8-1PGSTY~trixie_amd64.deb
postgresql-16-quantile1.1.8d13.aarch64pigsty21.1 KiBpostgresql-16-quantile_1.1.8-1PGSTY~trixie_arm64.deb
postgresql-16-quantile1.1.8u22.x86_64pigsty23.9 KiBpostgresql-16-quantile_1.1.8-1PGSTY~jammy_amd64.deb
postgresql-16-quantile1.1.8u22.aarch64pigsty23.1 KiBpostgresql-16-quantile_1.1.8-1PGSTY~jammy_arm64.deb
postgresql-16-quantile1.1.8u24.x86_64pigsty22.3 KiBpostgresql-16-quantile_1.1.8-1PGSTY~noble_amd64.deb
postgresql-16-quantile1.1.8u24.aarch64pigsty22.0 KiBpostgresql-16-quantile_1.1.8-1PGSTY~noble_arm64.deb
postgresql-16-quantile1.1.8u26.x86_64pigsty22.5 KiBpostgresql-16-quantile_1.1.8-1PGSTY~resolute_amd64.deb
postgresql-16-quantile1.1.8u26.aarch64pigsty22.1 KiBpostgresql-16-quantile_1.1.8-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
quantile_151.1.8el8.x86_64pigsty29.5 KiBquantile_15-1.1.8-1PGSTY.el8.x86_64.rpm
quantile_151.1.8el8.aarch64pigsty28.8 KiBquantile_15-1.1.8-1PGSTY.el8.aarch64.rpm
quantile_151.1.8el9.x86_64pigsty29.9 KiBquantile_15-1.1.8-1PGSTY.el9.x86_64.rpm
quantile_151.1.8el9.aarch64pigsty29.2 KiBquantile_15-1.1.8-1PGSTY.el9.aarch64.rpm
quantile_151.1.8el10.x86_64pigsty30.0 KiBquantile_15-1.1.8-1PGSTY.el10.x86_64.rpm
quantile_151.1.8el10.aarch64pigsty29.6 KiBquantile_15-1.1.8-1PGSTY.el10.aarch64.rpm
postgresql-15-quantile1.1.8d12.x86_64pigsty21.3 KiBpostgresql-15-quantile_1.1.8-1PGSTY~bookworm_amd64.deb
postgresql-15-quantile1.1.8d12.aarch64pigsty21.0 KiBpostgresql-15-quantile_1.1.8-1PGSTY~bookworm_arm64.deb
postgresql-15-quantile1.1.8d13.x86_64pigsty21.3 KiBpostgresql-15-quantile_1.1.8-1PGSTY~trixie_amd64.deb
postgresql-15-quantile1.1.8d13.aarch64pigsty21.1 KiBpostgresql-15-quantile_1.1.8-1PGSTY~trixie_arm64.deb
postgresql-15-quantile1.1.8u22.x86_64pigsty23.7 KiBpostgresql-15-quantile_1.1.8-1PGSTY~jammy_amd64.deb
postgresql-15-quantile1.1.8u22.aarch64pigsty22.8 KiBpostgresql-15-quantile_1.1.8-1PGSTY~jammy_arm64.deb
postgresql-15-quantile1.1.8u24.x86_64pigsty22.3 KiBpostgresql-15-quantile_1.1.8-1PGSTY~noble_amd64.deb
postgresql-15-quantile1.1.8u24.aarch64pigsty22.0 KiBpostgresql-15-quantile_1.1.8-1PGSTY~noble_arm64.deb
postgresql-15-quantile1.1.8u26.x86_64pigsty22.7 KiBpostgresql-15-quantile_1.1.8-1PGSTY~resolute_amd64.deb
postgresql-15-quantile1.1.8u26.aarch64pigsty22.1 KiBpostgresql-15-quantile_1.1.8-1PGSTY~resolute_arm64.deb

Source

pig build pkg quantile;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install quantile;		# install by package name

pig install quantile -v 19;   # install for PG 19
pig install quantile -v 18;   # install for PG 18
pig install quantile -v 17;   # install for PG 17
pig install quantile -v 16;   # install for PG 16
pig install quantile -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION quantile;

Usage

quantile: quantile aggregate functions for PostgreSQL

Provides aggregate functions to compute quantiles. Overloaded for int, bigint, double precision, and numeric.

CREATE EXTENSION quantile;

Functions

FunctionDescription
quantile(value, quantile float)Compute a single quantile (0 to 1)
quantile(value, quantiles float[])Compute multiple quantiles at once, returns array

Examples

-- Compute the median (0.5 quantile)
SELECT quantile(i, 0.5) FROM generate_series(1, 1000) s(i);
-- 500

-- Compute the 95th percentile
SELECT quantile(i, 0.95) FROM generate_series(1, 1000) s(i);

-- Compute all quartiles at once (more efficient than separate calls)
SELECT quantile(i, ARRAY[0.25, 0.5, 0.75])
FROM generate_series(1, 1000) s(i);
-- {250, 500, 750}

Note: Since PostgreSQL 9.4, built-in percentile_cont and percentile_disc functions are available. Consider using those first and only use this extension if it provides measurably better performance for your workload.

Table reader