jed

Functions & operators

The operator, aggregate, and set-returning catalog, generated at build time from spec/functions/catalog.toml. null describes NULL behavior (for example, kleene three-valued logic, or strict = NULL in, NULL out).

Operators

NameKindArgument typesResultNULL
orlogicalboolean, booleanbooleankleene
andlogicalboolean, booleanbooleankleene
notlogicalbooleanbooleanpropagates
eqcomparisoninteger, integerbooleanpropagates
necomparisoninteger, integerbooleanpropagates
ltcomparisoninteger, integerbooleanpropagates
gtcomparisoninteger, integerbooleanpropagates
lecomparisoninteger, integerbooleanpropagates
gecomparisoninteger, integerbooleanpropagates
is_distinct_fromcomparisoninteger, integerbooleannull_safe
is_not_distinct_fromcomparisoninteger, integerbooleannull_safe
eqcomparisontext, textbooleanpropagates
necomparisontext, textbooleanpropagates
ltcomparisontext, textbooleanpropagates
gtcomparisontext, textbooleanpropagates
lecomparisontext, textbooleanpropagates
gecomparisontext, textbooleanpropagates
is_distinct_fromcomparisontext, textbooleannull_safe
is_not_distinct_fromcomparisontext, textbooleannull_safe
likecomparisontext, textbooleanpropagates
ilikecomparisontext, textbooleanpropagates
regex_matchcomparisontext, textbooleanpropagates
regex_imatchcomparisontext, textbooleanpropagates
eqcomparisonboolean, booleanbooleanpropagates
necomparisonboolean, booleanbooleanpropagates
ltcomparisonboolean, booleanbooleanpropagates
gtcomparisonboolean, booleanbooleanpropagates
lecomparisonboolean, booleanbooleanpropagates
gecomparisonboolean, booleanbooleanpropagates
is_distinct_fromcomparisonboolean, booleanbooleannull_safe
is_not_distinct_fromcomparisonboolean, booleanbooleannull_safe
eqcomparisondecimal, decimalbooleanpropagates
necomparisondecimal, decimalbooleanpropagates
ltcomparisondecimal, decimalbooleanpropagates
gtcomparisondecimal, decimalbooleanpropagates
lecomparisondecimal, decimalbooleanpropagates
gecomparisondecimal, decimalbooleanpropagates
is_distinct_fromcomparisondecimal, decimalbooleannull_safe
is_not_distinct_fromcomparisondecimal, decimalbooleannull_safe
eqcomparisonbytea, byteabooleanpropagates
necomparisonbytea, byteabooleanpropagates
ltcomparisonbytea, byteabooleanpropagates
gtcomparisonbytea, byteabooleanpropagates
lecomparisonbytea, byteabooleanpropagates
gecomparisonbytea, byteabooleanpropagates
is_distinct_fromcomparisonbytea, byteabooleannull_safe
is_not_distinct_fromcomparisonbytea, byteabooleannull_safe
eqcomparisonuuid, uuidbooleanpropagates
necomparisonuuid, uuidbooleanpropagates
ltcomparisonuuid, uuidbooleanpropagates
gtcomparisonuuid, uuidbooleanpropagates
lecomparisonuuid, uuidbooleanpropagates
gecomparisonuuid, uuidbooleanpropagates
is_distinct_fromcomparisonuuid, uuidbooleannull_safe
is_not_distinct_fromcomparisonuuid, uuidbooleannull_safe
eqcomparisontimestamp, timestampbooleanpropagates
necomparisontimestamp, timestampbooleanpropagates
ltcomparisontimestamp, timestampbooleanpropagates
gtcomparisontimestamp, timestampbooleanpropagates
lecomparisontimestamp, timestampbooleanpropagates
gecomparisontimestamp, timestampbooleanpropagates
is_distinct_fromcomparisontimestamp, timestampbooleannull_safe
is_not_distinct_fromcomparisontimestamp, timestampbooleannull_safe
eqcomparisontimestamptz, timestamptzbooleanpropagates
necomparisontimestamptz, timestamptzbooleanpropagates
ltcomparisontimestamptz, timestamptzbooleanpropagates
gtcomparisontimestamptz, timestamptzbooleanpropagates
lecomparisontimestamptz, timestamptzbooleanpropagates
gecomparisontimestamptz, timestamptzbooleanpropagates
is_distinct_fromcomparisontimestamptz, timestamptzbooleannull_safe
is_not_distinct_fromcomparisontimestamptz, timestamptzbooleannull_safe
eqcomparisoninterval, intervalbooleanpropagates
necomparisoninterval, intervalbooleanpropagates
ltcomparisoninterval, intervalbooleanpropagates
gtcomparisoninterval, intervalbooleanpropagates
lecomparisoninterval, intervalbooleanpropagates
gecomparisoninterval, intervalbooleanpropagates
is_distinct_fromcomparisoninterval, intervalbooleannull_safe
is_not_distinct_fromcomparisoninterval, intervalbooleannull_safe
eqcomparisonfloat, floatbooleanpropagates
necomparisonfloat, floatbooleanpropagates
ltcomparisonfloat, floatbooleanpropagates
gtcomparisonfloat, floatbooleanpropagates
lecomparisonfloat, floatbooleanpropagates
gecomparisonfloat, floatbooleanpropagates
is_distinct_fromcomparisonfloat, floatbooleannull_safe
is_not_distinct_fromcomparisonfloat, floatbooleannull_safe
is_nullnull_testanybooleandetects
is_not_nullnull_testanybooleandetects
addarithmeticinteger, integerpromotedpropagates
subarithmeticinteger, integerpromotedpropagates
mularithmeticinteger, integerpromotedpropagates
divarithmeticinteger, integerpromotedpropagates
modarithmeticinteger, integerpromotedpropagates
negarithmeticintegerpromotedpropagates
addarithmeticdecimal, decimalpromotedpropagates
subarithmeticdecimal, decimalpromotedpropagates
mularithmeticdecimal, decimalpromotedpropagates
divarithmeticdecimal, decimalpromotedpropagates
modarithmeticdecimal, decimalpromotedpropagates
negarithmeticdecimalpromotedpropagates
addarithmeticinterval, intervalintervalpropagates
subarithmeticinterval, intervalintervalpropagates
negarithmeticintervalintervalpropagates
addarithmetictimestamp, intervaltimestamppropagates
addarithmeticinterval, timestamptimestamppropagates
subarithmetictimestamp, intervaltimestamppropagates
addarithmetictimestamptz, intervaltimestamptzpropagates
addarithmeticinterval, timestamptztimestamptzpropagates
subarithmetictimestamptz, intervaltimestamptzpropagates
subarithmetictimestamp, timestampintervalpropagates
subarithmetictimestamptz, timestamptzintervalpropagates
mularithmeticinterval, integerintervalpropagates
mularithmeticinteger, intervalintervalpropagates
mularithmeticinterval, decimalintervalpropagates
mularithmeticdecimal, intervalintervalpropagates
divarithmeticinterval, integerintervalpropagates
divarithmeticinterval, decimalintervalpropagates
addarithmeticdate, integerdatepropagates
addarithmeticinteger, datedatepropagates
subarithmeticdate, integerdatepropagates
subarithmeticdate, datei32propagates
addarithmeticdate, intervaltimestamppropagates
addarithmeticinterval, datetimestamppropagates
subarithmeticdate, intervaltimestamppropagates
addarithmeticfloat, floatpromotedpropagates
subarithmeticfloat, floatpromotedpropagates
mularithmeticfloat, floatpromotedpropagates
divarithmeticfloat, floatpromotedpropagates
modarithmeticfloat, floatpromotedpropagates
negarithmeticfloatpromotedpropagates
absfunctionintegerpromotedpropagates
absfunctiondecimalpromotedpropagates
roundfunctiondecimaldecimalpropagates
roundfunctiondecimal, integerdecimalpropagates
ceilfunctiondecimaldecimalpropagates
ceilingfunctiondecimaldecimalpropagates
floorfunctiondecimaldecimalpropagates
truncfunctiondecimaldecimalpropagates
truncfunctiondecimal, integerdecimalpropagates
absfunctionfloatpromotedpropagates
ceilfunctionfloatf64propagates
ceilingfunctionfloatf64propagates
floorfunctionfloatf64propagates
truncfunctionfloatf64propagates
roundfunctionfloatf64propagates
roundfunctionfloat, integerf64propagates
sqrtfunctionfloatf64propagates
expfunctionfloatf64propagates
lnfunctionfloatf64propagates
log10functionfloatf64propagates
powfunctionfloat, floatf64propagates
powerfunctionfloat, floatf64propagates
sqrtfunctiondecimaldecimalpropagates
expfunctiondecimaldecimalpropagates
lnfunctiondecimaldecimalpropagates
logfunctiondecimaldecimalpropagates
log10functiondecimaldecimalpropagates
logfunctiondecimal, decimaldecimalpropagates
powerfunctiondecimal, decimaldecimalpropagates
powfunctiondecimal, decimaldecimalpropagates
sinfunctionfloatf64propagates
cosfunctionfloatf64propagates
tanfunctionfloatf64propagates
cbrtfunctionfloatf64propagates
pifunction—f64propagates
radiansfunctionfloatf64propagates
degreesfunctionfloatf64propagates
asinfunctionfloatf64propagates
acosfunctionfloatf64propagates
atanfunctionfloatf64propagates
atan2functionfloat, floatf64propagates
cotfunctionfloatf64propagates
sinhfunctionfloatf64propagates
coshfunctionfloatf64propagates
tanhfunctionfloatf64propagates
asinhfunctionfloatf64propagates
acoshfunctionfloatf64propagates
atanhfunctionfloatf64propagates
signfunctiondecimaldecimalpropagates
signfunctionfloatf64propagates
factorialfunctionintegerdecimalpropagates
scalefunctiondecimali32propagates
min_scalefunctiondecimali32propagates
trim_scalefunctiondecimaldecimalpropagates
make_intervalfunctioninteger, integer, integer, integer, integer, integer, floatintervalpropagates
justify_hoursfunctionintervalintervalpropagates
justify_daysfunctionintervalintervalpropagates
justify_intervalfunctionintervalintervalpropagates
agefunctiontimestamp, timestampintervalpropagates
agefunctiontimestamptz, timestamptzintervalpropagates
agefunctiontimestampintervalpropagates
agefunctiontimestamptzintervalpropagates
make_timestampfunctioninteger, integer, integer, integer, integer, floattimestamppropagates
make_timestamptzfunctioninteger, integer, integer, integer, integer, floattimestamptzpropagates
make_timestamptzfunctioninteger, integer, integer, integer, integer, float, texttimestamptzpropagates
make_datefunctioninteger, integer, integerdatepropagates
current_datefunction—datepropagates
date_partfunctiontext, datef64propagates
date_partfunctiontext, timestampf64propagates
date_partfunctiontext, timestamptzf64propagates
date_partfunctiontext, intervalf64propagates
to_charfunctiontimestamp, texttextpropagates
to_charfunctiontimestamptz, texttextpropagates
to_charfunctioninterval, texttextpropagates
to_charfunctioninteger, texttextpropagates
to_charfunctiondecimal, texttextpropagates
to_charfunctionfloat, texttextpropagates
to_timestampfunctiontext, texttimestamptzpropagates
to_datefunctiontext, textdatepropagates
to_numberfunctiontext, textdecimalpropagates
to_timestampfunctionfloattimestamptzpropagates
uuid_extract_versionfunctionuuidi16propagates
uuid_extract_timestampfunctionuuidtimestamptzpropagates
uuidv4function—uuidpropagates
gen_random_uuidfunction—uuidpropagates
uuidv7function—uuidpropagates
uuidv7functionintervaluuidpropagates
nowfunction—timestamptzpropagates
clock_timestampfunction—timestamptzpropagates
nextvalfunctiontexti64propagates
currvalfunctiontexti64propagates
setvalfunctiontext, integeri64propagates
setvalfunctiontext, integer, booleani64propagates
lastvalfunction—i64propagates
current_settingfunctiontexttextpropagates
current_settingfunctiontext, booleantextpropagates
num_nullsfunctionanyi32none
num_nonnullsfunctionanyi32none
array_ndimsfunctionanyarrayi32propagates
array_lengthfunctionanyarray, integeri32propagates
array_lowerfunctionanyarray, integeri32propagates
array_upperfunctionanyarray, integeri32propagates
cardinalityfunctionanyarrayi32propagates
array_dimsfunctionanyarraytextpropagates
array_to_jsonfunctionanyarrayjsonpropagates
array_to_jsonfunctionanyarray, booleanjsonpropagates
array_appendfunctionanycompatiblearray, anycompatibleanycompatiblearraynone
array_prependfunctionanycompatible, anycompatiblearrayanycompatiblearraynone
array_catfunctionanycompatiblearray, anycompatiblearrayanycompatiblearraynone
array_removefunctionanycompatiblearray, anycompatibleanycompatiblearraynone
array_replacefunctionanycompatiblearray, anycompatible, anycompatibleanycompatiblearraynone
array_positionfunctionanycompatiblearray, anycompatiblei32none
array_positionfunctionanycompatiblearray, anycompatible, integeri32none
array_positionsfunctionanycompatiblearray, anycompatiblei32[]none
array_to_stringfunctionanyarray, texttextnone
array_to_stringfunctionanyarray, text, texttextnone
string_to_arrayfunctiontext, texttext[]none
string_to_arrayfunctiontext, text, texttext[]none
concatconcatanycompatiblearray, anycompatiblearrayanycompatiblearraynone
concatconcatanycompatiblearray, anycompatibleanycompatiblearraynone
concatconcatanycompatible, anycompatiblearrayanycompatiblearraynone
concatconcatbytea, byteabyteapropagates
concatconcattext, texttextpropagates
containscontainmentanyarray, anyarraybooleanpropagates
contained_bycontainmentanyarray, anyarraybooleanpropagates
overlapscontainmentanyarray, anyarraybooleanpropagates
containscontainmentanyrange, anyrangebooleanpropagates
containscontainmentanyrange, anyelementbooleanpropagates
contained_bycontainmentanyrange, anyrangebooleanpropagates
contained_bycontainmentanyelement, anyrangebooleanpropagates
overlapscontainmentanyrange, anyrangebooleanpropagates
strictly_leftcontainmentanyrange, anyrangebooleanpropagates
strictly_rightcontainmentanyrange, anyrangebooleanpropagates
not_extend_rightcontainmentanyrange, anyrangebooleanpropagates
not_extend_leftcontainmentanyrange, anyrangebooleanpropagates
adjacentcontainmentanyrange, anyrangebooleanpropagates
lowerfunctionanyrangeanyelementpropagates
upperfunctionanyrangeanyelementpropagates
lowerfunctiontexttextpropagates
upperfunctiontexttextpropagates
lengthfunctiontexti32propagates
lengthfunctionbyteai32propagates
char_lengthfunctiontexti32propagates
character_lengthfunctiontexti32propagates
octet_lengthfunctiontexti32propagates
octet_lengthfunctionbyteai32propagates
bit_lengthfunctiontexti32propagates
bit_lengthfunctionbyteai32propagates
substrfunctiontext, integertextpropagates
substrfunctiontext, integer, integertextpropagates
substrfunctionbytea, integerbyteapropagates
substrfunctionbytea, integer, integerbyteapropagates
substringfunctiontext, integertextpropagates
substringfunctiontext, integer, integertextpropagates
substringfunctionbytea, integerbyteapropagates
substringfunctionbytea, integer, integerbyteapropagates
substringfunctiontext, texttextpropagates
substringfunctiontext, text, texttextpropagates
overlayfunctiontext, text, integertextpropagates
overlayfunctiontext, text, integer, integertextpropagates
overlayfunctionbytea, bytea, integerbyteapropagates
overlayfunctionbytea, bytea, integer, integerbyteapropagates
leftfunctiontext, integertextpropagates
rightfunctiontext, integertextpropagates
lpadfunctiontext, integertextpropagates
lpadfunctiontext, integer, texttextpropagates
rpadfunctiontext, integertextpropagates
rpadfunctiontext, integer, texttextpropagates
btrimfunctiontexttextpropagates
btrimfunctiontext, texttextpropagates
btrimfunctionbytea, byteabyteapropagates
ltrimfunctiontexttextpropagates
ltrimfunctiontext, texttextpropagates
ltrimfunctionbytea, byteabyteapropagates
rtrimfunctiontexttextpropagates
rtrimfunctiontext, texttextpropagates
rtrimfunctionbytea, byteabyteapropagates
replacefunctiontext, text, texttextpropagates
translatefunctiontext, text, texttextpropagates
repeatfunctiontext, integertextpropagates
reversefunctiontexttextpropagates
strposfunctiontext, texti32propagates
positionfunctiontext, texti32propagates
positionfunctionbytea, byteai32propagates
split_partfunctiontext, text, integertextpropagates
starts_withfunctiontext, textbooleanpropagates
asciifunctiontexti32propagates
chrfunctionintegertextpropagates
initcapfunctiontexttextpropagates
to_hexfunctionintegertextpropagates
encodefunctionbytea, texttextpropagates
decodefunctiontext, textbyteapropagates
get_bytefunctionbytea, integeri32propagates
set_bytefunctionbytea, integer, integerbyteapropagates
get_bitfunctionbytea, integeri32propagates
set_bitfunctionbytea, integer, integerbyteapropagates
md5functiontexttextpropagates
md5functionbyteatextpropagates
sha224functionbyteabyteapropagates
sha256functionbyteabyteapropagates
sha384functionbyteabyteapropagates
sha512functionbyteabyteapropagates
quote_literalfunctiontexttextpropagates
quote_identfunctiontexttextpropagates
quote_nullablefunctiontexttextnone
like_escapefunctiontext, texttextpropagates
similar_to_escapefunctiontexttextpropagates
similar_to_escapefunctiontext, texttextpropagates
concatfunctionanytextnone
concat_wsfunctiontext, anytextnone
formatfunctiontext, anytextnone
regexp_replacefunctiontext, text, texttextpropagates
regexp_replacefunctiontext, text, text, texttextpropagates
regexp_matchfunctiontext, texttext[]propagates
regexp_matchfunctiontext, text, texttext[]propagates
regexp_split_to_arrayfunctiontext, texttext[]propagates
regexp_split_to_arrayfunctiontext, text, texttext[]propagates
regexp_likefunctiontext, textbooleanpropagates
regexp_likefunctiontext, text, textbooleanpropagates
regexp_countfunctiontext, texti32propagates
regexp_countfunctiontext, text, integeri32propagates
regexp_countfunctiontext, text, integer, texti32propagates
regexp_substrfunctiontext, texttextpropagates
regexp_substrfunctiontext, text, integertextpropagates
regexp_substrfunctiontext, text, integer, integertextpropagates
regexp_substrfunctiontext, text, integer, integer, texttextpropagates
regexp_substrfunctiontext, text, integer, integer, text, integertextpropagates
regexp_instrfunctiontext, texti32propagates
regexp_instrfunctiontext, text, integeri32propagates
regexp_instrfunctiontext, text, integer, integeri32propagates
regexp_instrfunctiontext, text, integer, integer, integeri32propagates
regexp_instrfunctiontext, text, integer, integer, integer, texti32propagates
regexp_instrfunctiontext, text, integer, integer, integer, text, integeri32propagates
isemptyfunctionanyrangebooleanpropagates
lower_incfunctionanyrangebooleanpropagates
upper_incfunctionanyrangebooleanpropagates
lower_inffunctionanyrangebooleanpropagates
upper_inffunctionanyrangebooleanpropagates
i32rangefunctioninteger, integeri32rangenone
i32rangefunctioninteger, integer, texti32rangenone
i64rangefunctioninteger, integeri64rangenone
i64rangefunctioninteger, integer, texti64rangenone
numrangefunctiondecimal, decimalnumrangenone
numrangefunctiondecimal, decimal, textnumrangenone
tsrangefunctiontimestamp, timestamptsrangenone
tsrangefunctiontimestamp, timestamp, texttsrangenone
tstzrangefunctiontimestamptz, timestamptztstzrangenone
tstzrangefunctiontimestamptz, timestamptz, texttstzrangenone
daterangefunctiondate, datedaterangenone
daterangefunctiondate, date, textdaterangenone
range_unionarithmeticanyrange, anyrangeanyrangepropagates
range_differencearithmeticanyrange, anyrangeanyrangepropagates
range_intersectarithmeticanyrange, anyrangeanyrangepropagates
range_mergefunctionanyrange, anyrangeanyrangepropagates
jsonb_typeoffunctionjsonbtextpropagates
json_typeoffunctionjsontextpropagates
jsonb_array_lengthfunctionjsonbi32propagates
json_array_lengthfunctionjsoni32propagates
jsonb_strip_nullsfunctionjsonbjsonbpropagates
json_strip_nullsfunctionjsonjsonpropagates
jsonb_prettyfunctionjsonbtextpropagates
to_jsonbfunctionanyjsonbpropagates
to_jsonfunctionanyjsonpropagates
json_scalarfunctionanyjsonpropagates
json_serializefunctionjsontextpropagates
json_serializefunctionjsonbtextpropagates
jsonb_build_arrayfunctionanyjsonbnone
json_build_arrayfunctionanyjsonnone
jsonb_build_objectfunctionanyjsonbnone
json_build_objectfunctionanyjsonnone

Aggregates

NameArgument typesResult
count_star—i64
countanyi64
sumintegersum_widen
sumdecimaldecimal
avgintegerdecimal
avgdecimaldecimal
sumfloatsame_as_input
avgfloatsame_as_input
minanysame_as_input
maxanysame_as_input
bool_andbooleanboolean
everybooleanboolean
bool_orbooleanboolean
bit_andintegersame_as_input
bit_orintegersame_as_input
bit_xorintegersame_as_input
string_aggtext, texttext
string_aggbytea, byteabytea
var_popintegerdecimal
var_popdecimaldecimal
var_popfloatf64
var_sampintegerdecimal
var_sampdecimaldecimal
var_sampfloatf64
varianceintegerdecimal
variancedecimaldecimal
variancefloatf64
stddev_popintegerdecimal
stddev_popdecimaldecimal
stddev_popfloatf64
stddev_sampintegerdecimal
stddev_sampdecimaldecimal
stddev_sampfloatf64
stddevintegerdecimal
stddevdecimaldecimal
stddevfloatf64
covar_popnumeric, numericf64
covar_sampnumeric, numericf64
corrnumeric, numericf64
regr_countnumeric, numerici64
regr_avgxnumeric, numericf64
regr_avgynumeric, numericf64
regr_sxxnumeric, numericf64
regr_syynumeric, numericf64
regr_sxynumeric, numericf64
regr_slopenumeric, numericf64
regr_interceptnumeric, numericf64
regr_r2numeric, numericf64
array_agganyarray_of_input
jsonb_agganyjsonb
json_agganyjson
jsonb_agg_strictanyjsonb
json_agg_strictanyjson

Set-returning functions

Called in FROM position as a computed row source — they expand their arguments into a set of rows. generate_series yields an integer series; unnest (polymorphic over anyarray) yields one row per array element. A function with a named output parameter (jsonb_array_elements → value) keeps that column name under a table alias; any other single-column function's column takes the table alias, else the function name. Fixed output columns can be renamed with AS relation(column, …).

NameArgument typesResult typeOutput columnNULL
generate_seriesinteger, integerset_of_promotedgenerate_series or the aliasempty_on_null
generate_seriesinteger, integer, integerset_of_promotedgenerate_series or the aliasempty_on_null
unnestanyarrayset_of_elementunnest or the aliasempty_on_null
jsonb_array_elementsjsonbjsonbvalueempty_on_null
jsonb_array_elements_textjsonbtextvalueempty_on_null
json_array_elementsjsonjsonvalueempty_on_null
json_array_elements_textjsontextvalueempty_on_null
jsonb_object_keysjsonbtextjsonb_object_keys or the aliasempty_on_null
json_object_keysjsontextjson_object_keys or the aliasempty_on_null
jsonb_eachjsonbjsonbvalueempty_on_null
jsonb_each_textjsonbtextvalueempty_on_null
json_eachjsonjsonvalueempty_on_null
json_each_textjsontextvalueempty_on_null
jsonb_path_queryjsonb, jsonpathjsonbjsonb_path_query or the aliasempty_on_null
regexp_matchestext, texttext[]regexp_matches or the aliasempty_on_null
regexp_matchestext, text, texttext[]regexp_matches or the aliasempty_on_null
regexp_split_to_tabletext, texttextregexp_split_to_table or the aliasempty_on_null
regexp_split_to_tabletext, text, texttextregexp_split_to_table or the aliasempty_on_null
jed — an embeddable, strictly-typed SQL database.