↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Functions

LEAST

The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details).

English manual coverage begins with PostgreSQL 7.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

group
conditional
group label
Conditional Expressions
lang
en
layout
table-new
pages
functions-conditional.html
prose only
false

Definition PG 18

The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details).

Signatures and overloads

LEAST(value [, ...])
The GREATEST and LEAST functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details).

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:2259dfa2cbe68f413f062def18c4b59ace0bb19ea2e0f4dc9cdd4f95bc82cc92

Text language: en · wiki-repair-20261023:2259dfa2cbe68f413f062def18c4b59ace0bb19ea2e0f4dc9cdd4f95bc82cc92