Skip to content

lower_quantile

Lower quantile aggregate function

lower_quantile · Lower quantile aggregate function

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4620lower_quantilelower_quantile1.0.3FUNCBSD-2-ClauseC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.0.319 18 17 16 15lower_quantile-
RPMPIGSTY1.0.319 18 17 16 15lower_quantile_$v-
DEBPIGSTY1.0.319 18 17 16 15postgresql-$v-lower-quantile-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el8.aarch64N/APIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el9.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el9.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el10.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
el10.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
d12.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
d12.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
d13.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
d13.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u22.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u22.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u24.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u24.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u26.x86_64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
u26.aarch64PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3PIGSTY 1.0.3
PackageVersionOSORGSIZEFile URL
lower_quantile_191.0.3el9.x86_64pigsty24.2 KiBlower_quantile_19-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_191.0.3el9.aarch64pigsty24.1 KiBlower_quantile_19-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_191.0.3el10.x86_64pigsty24.4 KiBlower_quantile_19-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_191.0.3el10.aarch64pigsty24.3 KiBlower_quantile_19-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-19-lower-quantile1.0.3d12.x86_64pigsty16.5 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-19-lower-quantile1.0.3d12.aarch64pigsty16.3 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-19-lower-quantile1.0.3d13.x86_64pigsty16.5 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-19-lower-quantile1.0.3d13.aarch64pigsty16.3 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-19-lower-quantile1.0.3u22.x86_64pigsty16.8 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-19-lower-quantile1.0.3u22.aarch64pigsty16.4 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-19-lower-quantile1.0.3u24.x86_64pigsty17.0 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-19-lower-quantile1.0.3u24.aarch64pigsty16.6 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-19-lower-quantile1.0.3u26.x86_64pigsty16.9 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-19-lower-quantile1.0.3u26.aarch64pigsty16.7 KiBpostgresql-19-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
lower_quantile_181.0.3el8.x86_64pigsty24.1 KiBlower_quantile_18-1.0.3-1PGSTY.el8.x86_64.rpm
lower_quantile_181.0.3el8.aarch64pigsty23.9 KiBlower_quantile_18-1.0.3-1PGSTY.el8.aarch64.rpm
lower_quantile_181.0.3el9.x86_64pigsty24.2 KiBlower_quantile_18-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_181.0.3el9.aarch64pigsty24.1 KiBlower_quantile_18-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_181.0.3el10.x86_64pigsty24.4 KiBlower_quantile_18-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_181.0.3el10.aarch64pigsty24.3 KiBlower_quantile_18-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-18-lower-quantile1.0.3d12.x86_64pigsty16.5 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-18-lower-quantile1.0.3d12.aarch64pigsty16.3 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-18-lower-quantile1.0.3d13.x86_64pigsty16.5 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-18-lower-quantile1.0.3d13.aarch64pigsty16.3 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-18-lower-quantile1.0.3u22.x86_64pigsty16.8 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-18-lower-quantile1.0.3u22.aarch64pigsty16.4 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-18-lower-quantile1.0.3u24.x86_64pigsty17.0 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-18-lower-quantile1.0.3u24.aarch64pigsty16.6 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-18-lower-quantile1.0.3u26.x86_64pigsty16.9 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-18-lower-quantile1.0.3u26.aarch64pigsty16.7 KiBpostgresql-18-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
lower_quantile_171.0.3el8.x86_64pigsty24.6 KiBlower_quantile_17-1.0.3-1PGSTY.el8.x86_64.rpm
lower_quantile_171.0.3el8.aarch64pigsty24.4 KiBlower_quantile_17-1.0.3-1PGSTY.el8.aarch64.rpm
lower_quantile_171.0.3el9.x86_64pigsty24.7 KiBlower_quantile_17-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_171.0.3el9.aarch64pigsty24.6 KiBlower_quantile_17-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_171.0.3el10.x86_64pigsty25.0 KiBlower_quantile_17-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_171.0.3el10.aarch64pigsty24.9 KiBlower_quantile_17-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-17-lower-quantile1.0.3d12.x86_64pigsty16.9 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-17-lower-quantile1.0.3d12.aarch64pigsty16.7 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-17-lower-quantile1.0.3d13.x86_64pigsty16.9 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-17-lower-quantile1.0.3d13.aarch64pigsty16.7 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-17-lower-quantile1.0.3u22.x86_64pigsty17.8 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-17-lower-quantile1.0.3u22.aarch64pigsty17.4 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-17-lower-quantile1.0.3u24.x86_64pigsty17.3 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-17-lower-quantile1.0.3u24.aarch64pigsty17.0 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-17-lower-quantile1.0.3u26.x86_64pigsty17.4 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-17-lower-quantile1.0.3u26.aarch64pigsty17.3 KiBpostgresql-17-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
lower_quantile_161.0.3el8.x86_64pigsty24.2 KiBlower_quantile_16-1.0.3-1PGSTY.el8.x86_64.rpm
lower_quantile_161.0.3el8.aarch64pigsty24.0 KiBlower_quantile_16-1.0.3-1PGSTY.el8.aarch64.rpm
lower_quantile_161.0.3el9.x86_64pigsty24.3 KiBlower_quantile_16-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_161.0.3el9.aarch64pigsty24.1 KiBlower_quantile_16-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_161.0.3el10.x86_64pigsty24.5 KiBlower_quantile_16-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_161.0.3el10.aarch64pigsty24.4 KiBlower_quantile_16-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-16-lower-quantile1.0.3d12.x86_64pigsty16.5 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-16-lower-quantile1.0.3d12.aarch64pigsty16.3 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-16-lower-quantile1.0.3d13.x86_64pigsty16.5 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-16-lower-quantile1.0.3d13.aarch64pigsty16.3 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-16-lower-quantile1.0.3u22.x86_64pigsty17.6 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-16-lower-quantile1.0.3u22.aarch64pigsty17.2 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-16-lower-quantile1.0.3u24.x86_64pigsty17.0 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-16-lower-quantile1.0.3u24.aarch64pigsty16.6 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-16-lower-quantile1.0.3u26.x86_64pigsty17.0 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-16-lower-quantile1.0.3u26.aarch64pigsty16.8 KiBpostgresql-16-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
lower_quantile_151.0.3el8.x86_64pigsty24.2 KiBlower_quantile_15-1.0.3-1PGSTY.el8.x86_64.rpm
lower_quantile_151.0.3el8.aarch64pigsty24.0 KiBlower_quantile_15-1.0.3-1PGSTY.el8.aarch64.rpm
lower_quantile_151.0.3el9.x86_64pigsty24.3 KiBlower_quantile_15-1.0.3-1PGSTY.el9.x86_64.rpm
lower_quantile_151.0.3el9.aarch64pigsty24.2 KiBlower_quantile_15-1.0.3-1PGSTY.el9.aarch64.rpm
lower_quantile_151.0.3el10.x86_64pigsty24.5 KiBlower_quantile_15-1.0.3-1PGSTY.el10.x86_64.rpm
lower_quantile_151.0.3el10.aarch64pigsty24.4 KiBlower_quantile_15-1.0.3-1PGSTY.el10.aarch64.rpm
postgresql-15-lower-quantile1.0.3d12.x86_64pigsty16.5 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~bookworm_amd64.deb
postgresql-15-lower-quantile1.0.3d12.aarch64pigsty16.3 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~bookworm_arm64.deb
postgresql-15-lower-quantile1.0.3d13.x86_64pigsty16.5 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~trixie_amd64.deb
postgresql-15-lower-quantile1.0.3d13.aarch64pigsty16.3 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~trixie_arm64.deb
postgresql-15-lower-quantile1.0.3u22.x86_64pigsty17.5 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~jammy_amd64.deb
postgresql-15-lower-quantile1.0.3u22.aarch64pigsty17.1 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~jammy_arm64.deb
postgresql-15-lower-quantile1.0.3u24.x86_64pigsty17.0 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~noble_amd64.deb
postgresql-15-lower-quantile1.0.3u24.aarch64pigsty16.6 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~noble_arm64.deb
postgresql-15-lower-quantile1.0.3u26.x86_64pigsty17.1 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~resolute_amd64.deb
postgresql-15-lower-quantile1.0.3u26.aarch64pigsty16.8 KiBpostgresql-15-lower-quantile_1.0.3-1PGSTY~resolute_arm64.deb

Source

pig build pkg lower_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 lower_quantile;		# install by package name

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

Create this extension with:

CREATE EXTENSION lower_quantile;

Usage

lower_quantile: lower quantile aggregate for PostgreSQL

Implements the “lower quantile” aggregate, which differs slightly from percentile_disc by returning the value whose rank in the sorted multiset is floor(1 + q*(n-1)).

CREATE EXTENSION lower_quantile;

Functions

FunctionDescription
lower_quantile(value, quantile float)Compute the lower quantile for the given quantile value (0 to 1)

Examples

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

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

This definition is used by some papers (e.g., the DDSketch paper) to formulate accuracy guarantees.

Table reader