Skip to main content

SQL Functions

Propel

Aggregate

FunctionSupported

AVG(numeric) → numeric

AVG_IF(numeric, boolean) → numeric

COUNT(*) → numeric

COUNT(any) → numeric

COUNT() → numeric

COUNT_IF(boolean) → numeric

COUNT_DISTINCT(any) → integer

FIRST(any) → any

FIRST(any, any) → any

LAST(any) → any

LAST(any, any) → any

SUM(numeric) → numeric

SUM_IF(numeric, boolean) → numeric

MIN(any) → any

MAX(any) → any

ANY(any) → any

PERCENTILE(numeric, numeric) → numeric

TOP_K(N integer, column any) → anyarray

General

FunctionSupported

IS_NULL(any) → boolean

TO_START_OF_MINUTE(date or timestamp) → timestamp

TO_START_OF_FIVE_MINUTES(date or timestamp) → timestamp

TO_START_OF_TEN_MINUTES(date or timestamp) → timestamp

TO_START_OF_FIFTEEN_MINUTES(date or timestamp) → timestamp

TO_START_OF_HOUR(date or timestamp) → timestamp

TO_START_OF_DAY(date or timestamp) → timestamp

TO_START_OF_WEEK(date or timestamp) → timestamp

TO_START_OF_MONTH(date or timestamp) → timestamp

TO_START_OF_YEAR(date or timestamp) → timestamp

TO_INTERVAL_SECOND(integer) → interval

TO_INTERVAL_MINUTE(integer) → interval

TO_INTERVAL_HOUR(integer) → interval

TO_INTERVAL_DAY(integer) → interval

TO_INTERVAL_WEEK(integer) → interval

TO_INTERVAL_MONTH(integer) → interval

TO_INTERVAL_QUARTER(integer) → interval

TO_INTERVAL_YEAR(integer) → interval

TO_SECOND(date or timestamp) → integer

TO_MINUTE(date or timestamp) → integer

TO_HOUR(date or timestamp) → integer

TO_DAY_OF_WEEK(date or timestamp) → integer

TO_DAY_OF_MONTH(date or timestamp) → integer

TO_DAY_OF_YEAR(date or timestamp) → integer

TO_ISO_WEEK(date or timestamp) → integer

TO_MONTH(date or timestamp) → integer

TO_QUARTER(date or timestamp) → integer

TO_YEAR(date or timestamp) → integer

ADD(numeric, numeric [, ...]) → numeric

SUBTRACT(numeric, numeric [, ...]) → numeric

MULTIPLY(numeric, numeric [, ...]) → numeric

DIVIDE(numeric, numeric [, ...]) → numeric

TIMESTAMP_DIFF(unit text, startdate any, enddate any [, timezone text]) → integer

DATE_DIFF(unit text, startdate any, enddate any [, timezone text]) → integer

DATE_TRUNC(unit text, value any [, timezone text]) → timestamp

TO_UNIX_TIMESTAMP(date or timestamp [, timezone text]) → integer

CAST(any, text) → any

CONCAT(s1 text, s2 text [, ...]) → text

CONCAT_WITH_SEPARATOR(separator text, s1 text, s2 text [, ...]) → text

TO_TIMESTAMP(str text, format text [, timezone text]) → timestamp

NOW() → timestamp

CURRENT_TIMESTAMP() → timestamp

FLOOR(numeric) → numeric

CEIL(numeric) → numeric

SUBSTRING(s text, offset integer [, length integer]) → text

PostgreSQL

Comparison Functions

FunctionSupported

num_nonnulls(VARIADIC "any") → integer

⌛️

num_nulls(VARIADIC "any") → integer

⌛️

Mathematical Functions

FunctionSupported

abs(numeric_type) → numeric_type

cbrt(double precision) → double precision

ceil(numeric) → numeric

ceil(double precision) → double precision

ceiling(numeric) → numeric

ceiling(double precision) → double precision

degrees(double precision) → double precision

div(y numeric, x numeric) → numeric

erf(double precision) → double precision

erfc(double precision) → double precision

exp(numeric) → numeric

exp(double precision) → double precision

factorial(big int) → numeric

floor(numeric) → numeric

floor(double precision) → double precision

gcd(numeric_type, numeric_type) → numeric_type

lcm(numeric_type, numeric_type) → numeric_type

ln(numeric) → numeric

ln(double precision) → double precision

log(numeric) → numeric

log(double precision) → double precision

log(b numeric, x numeric) → numeric

log10(numeric) → numeric

log10(double precision) → double precision

min_scale(numeric) → integer

⌛️

mod(y numeric_type, x numeric_type) → numeric_type

pi() → double precision

power(a numeric, b numeric) → numeric

power(a double precision, b double precision) → double precision

radians(double precision) → double precision

round(numeric) → numeric

round(double precision) → double precision

round(v numeric, s integer) → numeric

scale(numeric) → integer

⌛️

sign(numeric) → numeric

sign(double precision) → double precision

sqrt(numeric) → numeric

sqrt(double precision) → double precision

trim_scale(numeric) → numeric

⌛️

trunc(numeric) → numeric

trunc(double precision) → double precision

trunc(v numeric, s integer) → numeric

width_bucket(operand numeric, low numeric, high numeric, count integer) → integer

width_bucket(operand double precision, low double precision, high double precision, count integer) → integer

width_bucket(operand anycompatible, thresholds anycompatiblearray) → integer

random() → double precision

random_normal(mean double precision [, stddev double precision]) → double precision

setseed(double precision) → void

⌛️

acos(double precision) → double precision

acosd(double precision) → double precision

⌛️

asin(double precision) → double precision

asind(double precision) → double precision

⌛️

atan(double precision) → double precision

atand(double precision) → double precision

⌛️

atan2(y double precision, x double precision) → double precision

atan2d(y double precision, x double precision) → double precision

⌛️

cos(double precision) → double precision

cosd(double precision) → double precision

⌛️

cot(double precision) → double precision

⌛️

cotd(double precision) → double precision

⌛️

sin(double precision) → double precision

sind(double precision) → double precision

⌛️

tan(double precision) → double precision

tand(double precision) → double precision

⌛️

sinh(double precision) → double precision

cosh(double precision) → double precision

tanh(double precision) → double precision

⌛️

asinh(double precision) → double precision

acosh(double precision) → double precision

atanh(double precision) → double precision

String Functions

FunctionSupported

btrim(string text [, characters text]) → text

bit_length(text) → integer

char_length(text) → integer

character_length(text) → integer

lower(text) → text

lpad(string text, length integer [, fill text]) → text

ltrim(string text [, characters text]) → text

normalize(text [, form]) → text

octet_length(text) → integer

octet_length(character) → integer

rpad(string text, length integer [, fill text]) → text

rtrim(string text [, characters text]) → text

upper(text) → text

ascii(text) → integer

chr(integer) → text

concat(val1 "any" [, val2 "any" [, ...]]) → text

concat_ws(sep text, val1 "any" [, val2 "any" [, ...]]) → text

format(formatstr text [, formatarg "any" [, ...]]) → text

initcap(text) → text

left(string text, n integer) → text

⌛️

length(text) → integer

md5(text) → text

pg_client_encoding() → name

⌛️

quote_ident(text) → text

⌛️

quote_literal(text) → text

quote_literal(anyelement) → text

⌛️

quote_nullable(text) → text

quote_nullable(anyelement) → text

⌛️

regexp_count(string text, pattern text [, start integer] [, flags text]) → integer

⌛️

regexp_instr(string text, pattern text [, start integer] [, N integer] [, endoption integer] [, flags text] [, subexpr integer]) → integer

⌛️

regexp_like(string text, pattern text [, flags text]) → boolean

⌛️

regexp_replace(string text, pattern text, replacement text, start integer, N integer [, flags text]) → text

⌛️

regexp_split_to_table(string text, pattern text [, flags text]) → setof text

⌛️

regexp_substr(string text, pattern text [, start integer] [, N integer] [, flags text] [, subexpr integer]) → text

⌛️

repeat(string text, number integer) → text

replace(string text, from text, to text) → text

reverse(text) → text

right(string text, n integer) → text

⌛️

split_part(string text, delimiter text, n integer) → text

⌛️

starts_with(string text, prefix text) → boolean

⌛️

string_to_table(string text, delimiter text [, null_string text]) → setof text

⌛️

strpos(string text, substring text) → integer

⌛️

substr(string text, start integer [, count integer]) → text

to_ascii(string text) → text

to_ascii(string text, encoding name) → text

to_ascii(string text, encoding integer) → text

⌛️

to_hex(integer) → text

to_hex(big int) → text

translate(string text, from text, to text) → text

unistr(text) → text

⌛️

Binary String Functions

FunctionSupported

bit_length(bytea) → integer

btrim(bytes bytea, bytesremoved bytea) → bytea

ltrim(bytes bytea, bytesremoved bytea) → bytea

octet_length(bytea) → integer

rtrim(bytes bytea, bytesremoved bytea) → bytea

bit_count(bytes bytea) → bigint

get_bit(bytes bytea, n bigint) → integer

⌛️

get_byte(bytes bytea, n integer) → integer

length(bytea) → integer

length(bytes bytea, encoding name) → integer

md5(bytea) → text

set_bit(bytes bytea, n bigint, newvalue integer) → bytea

⌛️

set_byte(bytes bytea, n integer, newvalue integer) → bytea

⌛️

sha224(bytea) → bytea

sha256(bytea) → bytea

sha384(bytea) → bytea

⌛️

sha512(bytea) → bytea

substr(bytes bytea, start integer [, count integer]) → bytea

convert(bytes bytea, src_encoding name, dest_encoding name) → bytea

convert_from(bytes bytea, src_encoding name) → text

convert_to(string text, dest_encoding name) → bytea

encode(bytes bytea, format text) → text

decode(string text, format text) → bytea

Bit String Functions

FunctionSupported

bit_count(bit) → bigint

bit_length(bit) → integer

length(bit) → integer

octet_length(bit) → integer

get_bit(bits bit, n integer) → integer

⌛️

set_bit(bits bit, n integer, newvalue integer) → bit

⌛️

Data Type Formatting Functions

FunctionSupported

to_char(timestamp, text) → text

to_char(timestamp with time zone, text) → text

to_char(interval, text) → text

to_char(numeric_type, text) → text

⌛️

to_date(text, text) → date

⌛️

to_number(text, text) → numeric

⌛️

to_timestamp(text, text) → timestamp with time zone

⌛️

Date/Time Functions

FunctionSupported

age(timestamp, timestamp) → interval

age(timestamp) → interval

clock_timestamp() → timestamp with time zone

current_time(integer) → time with time zone

⌛️

current_timestamp(integer) → timestamp with time zone

date_add(timestamp with time zone, interval [, text]) → timestamp with time zone

date_bin(interval, timestamp, timestamp) → timestamp

⌛️

date_part(text, timestamp) → double precision

date_part(text, interval) → double precision

⌛️

date_subtract(timestamp with time zone, interval [, text]) → timestamp with time zone

⌛️

date_trunc(text, timestamp) → timestamp

date_trunc(text, timestamp with time zone, text) → timestamp with time zone

date_trunc(text, interval) → interval

isfinite(date) → boolean

isfinite(timestamp) → boolean

isfinite(interval) → boolean

justify_days(interval) → interval

⌛️

justify_hours(interval) → interval

⌛️

justify_interval(interval) → interval

⌛️

localtime(integer) → time

localtimestamp(integer) → timestamp

make_date(year int, month int, day int) → date

make_interval(years int [, months int] [, weeks int] [, days int] [, hours int] [, mins int] [, secs double precision]) → interval

⌛️

make_time(hour int, min int, sec double precision) → time

⌛️

make_timestamp(year int, month int, day int, hour int, min int, sec double precision) → timestamp

⌛️

make_timestamptz(year int, month int, day int, hour int, min int, sec double precision [, timezone text]) → timestamp with time zone

⌛️

now() → timestamp with time zone

statement_timestamp() → timestamp with time zone

timeofday() → text

⌛️

transaction_timestamp() → timestamp with time zone

to_timestamp(double precision) → timestamp with time zone

⌛️

Enum Support Functions

FunctionSupported

enum_first(anyenum) → anyenum

⌛️

enum_last(anyenum) → anyenum

⌛️

enum_range(anyenum) → anyarray

enum_range(anyenum, anyenum) → anyarray

⌛️

Geometric Functions

FunctionSupported

area(geometric_type) → double precision

⌛️

center(geometric_type) → point

⌛️

diameter(circle) → double precision

⌛️

height(box) → double precision

⌛️

isclosed(path) → boolean

⌛️

isopen(path) → boolean

⌛️

length(geometric_type) → double precision

npoints(geometric_type) → integer

⌛️

pclose(path) → path

⌛️

popen(path) → path

⌛️

radius(circle) → double precision

⌛️

slope(point, po int) → double precision

⌛️

width(box) → double precision

⌛️

box(circle) → box

box(po int) → box

box(point, po int) → box

box(polygon) → box

⌛️

bound_box(box, box) → box

⌛️

circle(box) → circle

circle(point, double precision) → circle

circle(polygon) → circle

⌛️

path(polygon) → path

⌛️

point(double precision, double precision) → point

point(box) → point

point(circle) → point

point(polygon) → point

⌛️

polygon(box) → polygon

polygon(circle) → polygon

polygon(integer, circle) → polygon

polygon(path) → polygon

⌛️

Network Address Functions

FunctionSupported

abbrev(inet) → text

abbrev(cidr) → text

⌛️

broadcast(inet) → inet

⌛️

family(inet) → integer

⌛️

host(inet) → text

⌛️

hostmask(inet) → inet

⌛️

inet_merge(inet, inet) → cidr

⌛️

inet_same_family(inet, inet) → boolean

⌛️

masklen(inet) → integer

⌛️

netmask(inet) → inet

⌛️

network(inet) → cidr

⌛️

set_masklen(inet, integer) → inet

set_masklen(cidr, integer) → cidr

⌛️

text(inet) → text

⌛️

trunc(macaddr) → macaddr

trunc(macaddr8) → macaddr8

macaddr8_set7bit(macaddr8) → macaddr8

⌛️

Text Search Functions

FunctionSupported

get_current_ts_config() → regconfig

⌛️

length(tsvector) → integer

numnode(tsquery) → integer

⌛️

querytree(tsquery) → text

⌛️

setweight(vector tsvector, weight "char") → tsvector

⌛️

strip(tsvector) → tsvector

⌛️

ts_delete(vector tsvector, lexeme text) → tsvector

⌛️

ts_rewrite(query tsquery, target tsquery, substitute tsquery) → tsquery

ts_rewrite(query tsquery, select text) → tsquery

⌛️

tsquery_phrase(query1 tsquery, query2 tsquery) → tsquery

tsquery_phrase(query1 tsquery, query2 tsquery, distance integer) → tsquery

⌛️

UUID Functions

FunctionSupported

gen_random_uuid() → uuid

XML Functions

FunctionSupported

xmlcomment(text) → xml

⌛️

xmlconcat(xml [, ...]) → xml

xmlagg(xml) → xml

⌛️

xml_is_well_formed(text) → boolean

⌛️

xml_is_well_formed_document(text) → boolean

⌛️

xml_is_well_formed_content(text) → boolean

⌛️

table_to_xml(table regclass, nulls boolean, tableforest boolean, targetns text) → xml

⌛️

query_to_xml(query text, nulls boolean, tableforest boolean, targetns text) → xml

⌛️

table_to_xmlschema(table regclass, nulls boolean, tableforest boolean, targetns text) → xml

⌛️

query_to_xmlschema(query text, nulls boolean, tableforest boolean, targetns text) → xml

⌛️

table_to_xml_and_xmlschema(table regclass, nulls boolean, tableforest boolean, targetns text) → xml

⌛️

query_to_xml_and_xmlschema(query text, nulls boolean, tableforest boolean, targetns text) → xml

⌛️

schema_to_xml(schema name, nulls boolean, tableforest boolean, targetns text) → xml

⌛️

schema_to_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text) → xml

⌛️

schema_to_xml_and_xmlschema(schema name, nulls boolean, tableforest boolean, targetns text) → xml

⌛️

database_to_xml(nulls boolean, tableforest boolean, targetns text) → xml

⌛️

database_to_xmlschema(nulls boolean, tableforest boolean, targetns text) → xml

⌛️

database_to_xml_and_xmlschema(nulls boolean, tableforest boolean, targetns text) → xml

⌛️

JSON Functions

FunctionSupported

to_json(anyelement) → json

⌛️

to_jsonb(anyelement) → jsonb

⌛️

array_to_json(anyarray [, boolean]) → json

⌛️

json_build_array(VARIADIC "any") → json

⌛️

jsonb_build_array(VARIADIC "any") → jsonb

⌛️

json_build_object(VARIADIC "any") → json

⌛️

jsonb_build_object(VARIADIC "any") → jsonb

⌛️

json_array_elements(json) → setof json

jsonb_array_elements(jsonb) → setof jsonb

json_array_elements_text(json) → setof text

jsonb_array_elements_text(jsonb) → setof text

json_array_length(json) → integer

jsonb_array_length(jsonb) → integer

json_object_keys(json) → setof text

jsonb_object_keys(jsonb) → setof text

json_populate_record(base anyelement, from_json json) → anyelement

⌛️

jsonb_populate_record(base anyelement, from_json jsonb) → anyelement

⌛️

json_populate_recordset(base anyelement, from_json json) → setof anyelement

⌛️

jsonb_populate_recordset(base anyelement, from_json jsonb) → setof anyelement

⌛️

json_strip_nulls(json) → json

⌛️

jsonb_strip_nulls(jsonb) → jsonb

⌛️

jsonb_pretty(jsonb) → text

⌛️

json_typeof(json) → text

jsonb_typeof(jsonb) → text

Sequence Manipulation Functions

FunctionSupported

nextval(regclass) → bigint

⌛️

setval(regclass, big int [, boolean]) → bigint

⌛️

currval(regclass) → bigint

⌛️

lastval() → bigint

⌛️

Conditional Expressions

FunctionSupported

COALESCE(any [, ...]) → any

NULLIF(value1 any, value2 any) → any

GREATEST(value any [, ...]) → any

LEAST(value any [, ...]) → any

Array Functions

FunctionSupported

array_append(anycompatiblearray, anycompatible) → anycompatiblearray

⌛️

array_cat(anycompatiblearray, anycompatiblearray) → anycompatiblearray

⌛️

array_dims(anyarray) → text

⌛️

array_length(anyarray, integer) → integer

⌛️

array_lower(anyarray, integer) → integer

⌛️

array_ndims(anyarray) → integer

⌛️

array_position(anycompatiblearray, anycompatible [, integer]) → integer

⌛️

array_prepend(anycompatible, anycompatiblearray) → anycompatiblearray

⌛️

array_remove(anycompatiblearray, anycompatible) → anycompatiblearray

⌛️

array_replace(anycompatiblearray, anycompatible, anycompatible) → anycompatiblearray

⌛️

array_sample(array anyarray, n integer) → anyarray

⌛️

array_shuffle(anyarray) → anyarray

⌛️

array_to_string(array anyarray, delimiter text [, null_string text]) → text

⌛️

array_upper(anyarray, integer) → integer

⌛️

cardinality(anyarray) → integer

⌛️

trim_array(array anyarray, n integer) → anyarray

⌛️

unnest(anyarray) → setof anyelement

Range/Multirange Functions

FunctionSupported

lower(anyrange) → anyelement

lower(anymultirange) → anyelement

upper(anyrange) → anyelement

upper(anymultirange) → anyelement

isempty(anyrange) → boolean

isempty(anymultirange) → boolean

⌛️

lower_inc(anyrange) → boolean

lower_inc(anymultirange) → boolean

⌛️

upper_inc(anyrange) → boolean

upper_inc(anymultirange) → boolean

⌛️

lower_inf(anyrange) → boolean

lower_inf(anymultirange) → boolean

⌛️

upper_inf(anyrange) → boolean

upper_inf(anymultirange) → boolean

⌛️

range_merge(anyrange, anyrange) → anyrange

range_merge(anymultirange) → anyrange

⌛️

multirange(anyrange) → anymultirange

⌛️

unnest(anymultirange) → setof anyrange

Aggregate Functions

FunctionSupported

any_value(anyelement) → same as input type

array_agg(anynonarray) → anyarray

array_agg(anyarray) → anyarray

⌛️

avg(small int) → numeric

avg(integer) → numeric

avg(big int) → numeric

avg(numeric) → numeric

avg(real) → double precision

avg(double precision) → double precision

avg(interval) → interval

bit_and(small int) → smallint

bit_and(integer) → integer

bit_and(big int) → bigint

bit_and(bit) → bit

bit_or(small int) → smallint

bit_or(integer) → integer

bit_or(big int) → bigint

bit_or(bit) → bit

bit_xor(small int) → smallint

bit_xor(integer) → integer

bit_xor(big int) → bigint

bit_xor(bit) → bit

bool_and(boolean) → boolean

bool_or(boolean) → boolean

count(*) → bigint

count("any") → bigint

every(boolean) → boolean

json_agg(anyelement) → json

⌛️

jsonb_agg(anyelement) → jsonb

⌛️

json_object_agg(key "any", value "any") → json

⌛️

jsonb_object_agg(key "any", value "any") → jsonb

⌛️

json_object_agg_strict(key "any", value "any") → json

⌛️

jsonb_object_agg_strict(key "any", value "any") → jsonb

⌛️

json_object_agg_unique(key "any", value "any") → json

⌛️

jsonb_object_agg_unique(key "any", value "any") → jsonb

⌛️

json_object_agg_unique_strict(key "any", value "any") → json

⌛️

jsonb_object_agg_unique_strict(key "any", value "any") → jsonb

⌛️

max(see text) → same as input type

min(see text) → same as input type

range_agg(value anyrange) → anymultirange

range_agg(value anymultirange) → anymultirange

⌛️

range_intersect_agg(value anyrange) → anyrange

range_intersect_agg(value anymultirange) → anymultirange

⌛️

json_agg_strict(anyelement) → json

⌛️

jsonb_agg_strict(anyelement) → jsonb

⌛️

string_agg(value text, delimiter text) → text

string_agg(value bytea, delimiter bytea) → bytea

⌛️

sum(small int) → bigint

sum(integer) → bigint

sum(big int) → numeric

sum(numeric) → numeric

sum(real) → real

sum(double precision) → double precision

sum(interval) → interval

sum(money) → money

xmlagg(xml) → xml

⌛️

corr(Y double precision, X double precision) → double precision

covar_pop(Y double precision, X double precision) → double precision

covar_samp(Y double precision, X double precision) → double precision

regr_avgx(Y double precision, X double precision) → double precision

⌛️

regr_avgy(Y double precision, X double precision) → double precision

⌛️

regr_count(Y double precision, X double precision) → bigint

⌛️

regr_intercept(Y double precision, X double precision) → double precision

⌛️

regr_r2(Y double precision, X double precision) → double precision

⌛️

regr_slope(Y double precision, X double precision) → double precision

⌛️

regr_sxx(Y double precision, X double precision) → double precision

⌛️

regr_sxy(Y double precision, X double precision) → double precision

⌛️

regr_syy(Y double precision, X double precision) → double precision

⌛️

Window Functions

FunctionSupported

row_number() → bigint

⌛️

rank() → bigint

⌛️

dense_rank() → bigint

⌛️

percent_rank() → double precision

⌛️

cume_dist() → double precision

⌛️

ntile(num_buckets integer) → integer

⌛️

lag(value anycompatible [, offset integer] [, default anycompatible]) → anycompatible

⌛️

lead(value anycompatible [, offset integer] [, default anycompatible]) → anycompatible

⌛️

first_value(value anyelement) → anyelement

last_value(value anyelement) → anyelement

nth_value(value anyelement, n integer) → anyelement

⌛️

Set Returning Functions

FunctionSupported

generate_series(start integer, stop integer [, step integer]) → setof integer

generate_series(start bigint, stop bigint [, step bigint]) → setof bigint

generate_series(start numeric, stop numeric [, step numeric]) → setof numeric

generate_series(start timestamp, stop timestamp, step interval) → setof timestamp

generate_series(start timestamp with time zone, stop timestamp with time zone, step interval [, timezone text]) → setof timestamp with time zone

⌛️

generate_subscripts(array anyarray, dim integer) → setof integer

generate_subscripts(array anyarray, dim integer, reverse boolean) → setof integer

⌛️

System Information Functions

FunctionSupported

current_database() → name

current_query() → text

⌛️

current_schema() → name

⌛️

inet_client_addr() → inet

⌛️

inet_client_port() → integer

⌛️

inet_server_addr() → inet

⌛️

inet_server_port() → integer

⌛️

pg_backend_pid() → integer

⌛️

pg_conf_load_time() → timestamp with time zone

⌛️

pg_current_logfile(text) → text

⌛️

pg_my_temp_schema() → oid

⌛️

pg_is_other_temp_schema(oid) → boolean

⌛️

pg_jit_available() → boolean

⌛️

pg_listening_channels() → setof text

⌛️

pg_notification_queue_usage() → double precision

⌛️

pg_postmaster_start_time() → timestamp with time zone

⌛️

pg_trigger_depth() → integer

⌛️

version() → text

row_security_active(table text or oid) → boolean

⌛️

pg_collation_is_visible(collation oid) → boolean

⌛️

pg_conversion_is_visible(conversion oid) → boolean

⌛️

pg_function_is_visible(function oid) → boolean

⌛️

pg_opclass_is_visible(opclass oid) → boolean

⌛️

pg_operator_is_visible(operator oid) → boolean

⌛️

pg_opfamily_is_visible(opclass oid) → boolean

⌛️

pg_statistics_obj_is_visible(stat oid) → boolean

⌛️

pg_table_is_visible(table oid) → boolean

⌛️

pg_ts_config_is_visible(config oid) → boolean

⌛️

pg_ts_dict_is_visible(dict oid) → boolean

⌛️

pg_ts_parser_is_visible(parser oid) → boolean

⌛️

pg_ts_template_is_visible(template oid) → boolean

⌛️

pg_type_is_visible(type oid) → boolean

⌛️

format_type(type oid, typemod integer) → text

⌛️

pg_char_to_encoding(encoding name) → integer

⌛️

pg_encoding_to_char(encoding integer) → name

⌛️

pg_get_constraintdef(constraint oid [, pretty boolean]) → text

⌛️

pg_get_expr(expr pg_node_tree, relation oid [, pretty boolean]) → text

⌛️

pg_get_functiondef(func oid) → text

⌛️

pg_get_function_arguments(func oid) → text

⌛️

pg_get_function_identity_arguments(func oid) → text

⌛️

pg_get_function_result(func oid) → text

⌛️

pg_get_indexdef(index oid [, column integer] [, pretty boolean]) → text

⌛️

pg_get_partkeydef(table oid) → text

⌛️

pg_get_ruledef(rule oid [, pretty boolean]) → text

⌛️

pg_get_serial_sequence(table text, column text) → text

⌛️

pg_get_statisticsobjdef(statobj oid) → text

⌛️

pg_get_triggerdef(trigger oid [, pretty boolean]) → text

⌛️

pg_get_userbyid(role oid) → name

⌛️

pg_get_viewdef(view oid [, pretty boolean]) → text

pg_get_viewdef(view oid, wrap_column integer) → text

pg_get_viewdef(view text [, pretty boolean]) → text

⌛️

pg_index_column_has_property(index regclass, column integer, property text) → boolean

⌛️

pg_index_has_property(index regclass, property text) → boolean

⌛️

pg_indexam_has_property(am oid, property text) → boolean

⌛️

pg_tablespace_databases(tablespace oid) → setof oid

⌛️

pg_tablespace_location(tablespace oid) → text

⌛️

pg_typeof("any") → regtype

⌛️

to_regclass(text) → regclass

⌛️

to_regcollation(text) → regcollation

⌛️

to_regnamespace(text) → regnamespace

⌛️

to_regoper(text) → regoper

⌛️

to_regoperator(text) → regoperator

⌛️

to_regproc(text) → regproc

⌛️

to_regprocedure(text) → regprocedure

⌛️

to_regrole(text) → regrole

⌛️

to_regtype(text) → regtype

⌛️

pg_describe_object(classid oid, objid oid, objsubid integer) → text

⌛️

col_description(table oid, column integer) → text

⌛️

obj_description(object oid, catalog name) → text

obj_description(object oid) → text

⌛️

shobj_description(object oid, catalog name) → text

⌛️

pg_input_is_valid(string text, type text) → boolean

⌛️

pg_current_xact_id() → xid8

⌛️

pg_current_xact_id_if_assigned() → xid8

⌛️

pg_xact_status(xid8) → text

⌛️

pg_current_snapshot() → pg_snapshot

⌛️

pg_snapshot_xip(pg_snapshot) → setof xid8

⌛️

pg_snapshot_xmax(pg_snapshot) → xid8

⌛️

pg_snapshot_xmin(pg_snapshot) → xid8

⌛️

pg_visible_in_snapshot(xid8, pg_snapshot) → boolean

⌛️

txid_current() → bigint

⌛️

txid_current_if_assigned() → bigint

⌛️

txid_current_snapshot() → txid_snapshot

⌛️

txid_snapshot_xip(txid_snapshot) → setof bigint

⌛️

txid_snapshot_xmax(txid_snapshot) → bigint

⌛️

txid_snapshot_xmin(txid_snapshot) → bigint

⌛️

txid_visible_in_snapshot(bigint, txid_snapshot) → boolean

⌛️

txid_status(big int) → text

⌛️

pg_xact_commit_timestamp(xid) → timestamp with time zone

⌛️

age(xid) → integer

mxid_age(xid) → integer

⌛️

System Administration Functions

FunctionSupported

current_setting(setting_name text [, missing_ok boolean]) → text

⌛️

set_config(setting_name text, new_value text, is_local boolean) → text

⌛️

pg_cancel_backend(pid integer) → boolean

⌛️

pg_log_backend_memory_contexts(pid integer) → boolean

⌛️

pg_reload_conf() → boolean

⌛️

pg_rotate_logfile() → boolean

⌛️

pg_create_restore_point(name text) → pg_lsn

⌛️

pg_current_wal_flush_lsn() → pg_lsn

⌛️

pg_current_wal_insert_lsn() → pg_lsn

⌛️

pg_current_wal_lsn() → pg_lsn

⌛️

pg_backup_start(label text [, fast boolean]) → pg_lsn

⌛️

pg_switch_wal() → pg_lsn

⌛️

pg_walfile_name(lsn pg_lsn) → text

⌛️

pg_wal_lsn_diff(lsn1 pg_lsn, lsn2 pg_lsn) → numeric

⌛️

pg_is_in_recovery() → boolean

⌛️

pg_last_wal_receive_lsn() → pg_lsn

⌛️

pg_last_wal_replay_lsn() → pg_lsn

⌛️

pg_last_xact_replay_timestamp() → timestamp with time zone

⌛️

pg_is_wal_replay_paused() → boolean

⌛️

pg_get_wal_replay_pause_state() → text

⌛️

pg_wal_replay_pause() → void

⌛️

pg_wal_replay_resume() → void

⌛️

pg_export_snapshot() → text

⌛️

pg_log_standby_snapshot() → pg_lsn

⌛️

pg_drop_replication_slot(slot_name name) → void

⌛️

pg_replication_origin_create(node_name text) → oid

⌛️

pg_replication_origin_drop(node_name text) → void

⌛️

pg_replication_origin_oid(node_name text) → oid

⌛️

pg_replication_origin_session_setup(node_name text) → void

⌛️

pg_replication_origin_session_reset() → void

⌛️

pg_replication_origin_session_is_setup() → boolean

⌛️

pg_replication_origin_session_progress(flush boolean) → pg_lsn

⌛️

pg_replication_origin_xact_setup(origin_lsn pg_lsn, origin_timestamp timestamp with time zone) → void

⌛️

pg_replication_origin_xact_reset() → void

⌛️

pg_replication_origin_advance(node_name text, lsn pg_lsn) → void

⌛️

pg_replication_origin_progress(node_name text, flush boolean) → pg_lsn

⌛️

pg_logical_emit_message(transactional boolean, prefix text, content text) → pg_lsn

pg_logical_emit_message(transactional boolean, prefix text, content bytea) → pg_lsn

⌛️

pg_column_size("any") → integer

⌛️

pg_column_compression("any") → text

⌛️

pg_database_size(name) → bigint

pg_database_size(oid) → bigint

⌛️

pg_indexes_size(regclass) → bigint

⌛️

pg_relation_size(relation regclass [, fork text]) → bigint

⌛️

pg_size_bytes(text) → bigint

⌛️

pg_size_pretty(big int) → text

pg_size_pretty(numeric) → text

⌛️

pg_table_size(regclass) → bigint

⌛️

pg_tablespace_size(name) → bigint

pg_tablespace_size(oid) → bigint

⌛️

pg_total_relation_size(regclass) → bigint

⌛️

pg_relation_filenode(relation regclass) → oid

⌛️

pg_relation_filepath(relation regclass) → text

⌛️

pg_filenode_relation(tablespace oid, filenode oid) → regclass

⌛️

pg_collation_actual_version(oid) → text

⌛️

pg_database_collation_actual_version(oid) → text

⌛️

pg_import_system_collations(schema regnamespace) → integer

⌛️

pg_partition_ancestors(regclass) → setof regclass

⌛️

pg_partition_root(regclass) → regclass

⌛️

brin_summarize_new_values(index regclass) → integer

⌛️

brin_summarize_range(index regclass, blockNumber bigint) → integer

⌛️

brin_desummarize_range(index regclass, blockNumber bigint) → void

⌛️

gin_clean_pending_list(index regclass) → bigint

⌛️

pg_ls_dir(dirname text [, missing_ok boolean] [, include_dot_dirs boolean]) → setof text

⌛️

pg_advisory_lock(key bigint) → void

pg_advisory_lock(key1 integer, key2 integer) → void

⌛️

pg_advisory_lock_shared(key bigint) → void

pg_advisory_lock_shared(key1 integer, key2 integer) → void

⌛️

pg_advisory_unlock(key bigint) → boolean

pg_advisory_unlock(key1 integer, key2 integer) → boolean

⌛️

pg_advisory_unlock_all() → void

⌛️

pg_advisory_unlock_shared(key bigint) → boolean

pg_advisory_unlock_shared(key1 integer, key2 integer) → boolean

⌛️

pg_advisory_xact_lock(key bigint) → void

pg_advisory_xact_lock(key1 integer, key2 integer) → void

⌛️

pg_advisory_xact_lock_shared(key bigint) → void

pg_advisory_xact_lock_shared(key1 integer, key2 integer) → void

⌛️

pg_try_advisory_lock(key bigint) → boolean

pg_try_advisory_lock(key1 integer, key2 integer) → boolean

⌛️

pg_try_advisory_lock_shared(key bigint) → boolean

pg_try_advisory_lock_shared(key1 integer, key2 integer) → boolean

⌛️

pg_try_advisory_xact_lock(key bigint) → boolean

pg_try_advisory_xact_lock(key1 integer, key2 integer) → boolean

⌛️

pg_try_advisory_xact_lock_shared(key bigint) → boolean

pg_try_advisory_xact_lock_shared(key1 integer, key2 integer) → boolean

⌛️

Trigger Functions

FunctionSupported

suppress_redundant_updates_trigger() → trigger

⌛️

tsvector_update_trigger() → trigger

⌛️

tsvector_update_trigger_column() → trigger

⌛️

Event Trigger Functions

FunctionSupported

pg_event_trigger_table_rewrite_oid() → oid

⌛️

pg_event_trigger_table_rewrite_reason() → integer

⌛️

ClickHouse

Arithmetic Functions

FunctionSupported

plus(a numeric, b numeric) → numeric

plus(a integer, b date) → date

plus(a date, b integer) → date

plus(a integer, b timestamp) → timestamp

plus(a timestamp, b integer) → timestamp

minus(a numeric, b numeric) → numeric

minus(a integer, b date) → date

minus(a date, b integer) → date

minus(a integer, b timestamp) → timestamp

minus(a timestamp, b integer) → timestamp

multiply(a numeric, b numeric) → numeric

divide(a numeric, b numeric) → float64

intDiv(a numeric, b numeric) → integer

intDivOrZero(a numeric, b numeric) → integer

modulo(a integer, b integer) → integer

modulo(a numeric, b numeric) → float64

moduloOrZero(a integer, b integer) → integer

moduloOrZero(a numeric, b numeric) → float64

positiveModulo(a integer, b integer) → integer

positiveModulo(a numeric, b numeric) → float64

negate(a numeric) → numeric

abs(a numeric) → numeric

gcd(a numeric, b numeric) → numeric

lcm(a numeric, b numeric) → numeric

max2(a numeric, b numeric) → float64

min2(a numeric, b numeric) → float64

multiplyDecimal(a decimal, b decimal [, result_scale integer]) → decimal256

divideDecimal(a decimal, b decimal [, result_scale integer]) → decimal256

byteSwap(a integer) → integer

Array Functions

FunctionSupported

empty(anyarray) → boolean

notEmpty(anyarray) → boolean

length(anyarray) → uint64

emptyArrayUInt8() → anyarray

emptyArrayUInt16() → anyarray

emptyArrayUInt32() → anyarray

emptyArrayUInt64() → anyarray

emptyArrayInt8() → anyarray

emptyArrayInt16() → anyarray

emptyArrayInt32() → anyarray

emptyArrayInt64() → anyarray

emptyArrayFloat32() → anyarray

emptyArrayFloat64() → anyarray

emptyArrayDate() → anyarray

emptyArrayDateTime() → anyarray

emptyArrayString() → anyarray

emptyArrayToSingle(anyarray) → anyarray

array(x1 any [, ...]) → anyarray

arrayWithConstant(length integer, elem any) → anyarray

arrayConcat(arrays anyarray) → anyarray

arrayElement(arr anyarray, n integer) → any

has(arr anyarray, elem any) → boolean

hasAll(set anyarray, subset anyarray) → boolean

hasAny(array1 anyarray, array2 anyarray) → boolean

hasSubstr(array1 anyarray, array2 anyarray) → boolean

indexOf(arr anyarray, x any) → integer

countEqual(arr anyarray, x any) → integer

arrayEnumerate(arr anyarray) → anyarray

arrayEnumerateUniq(arr anyarray) → anyarray

arrayPopBack(array anyarray) → anyarray

arrayPopFront(array anyarray) → anyarray

arrayPushBack(array anyarray, single_value any) → anyarray

arrayPushFront(array anyarray, single_value any) → anyarray

arrayResize(array anyarray, size integer [, extender any]) → anyarray

arraySlice(array anyarray, offset integer [, length integer]) → anyarray

arrayShingles(array anyarray, length integer) → anyarray

arrayUniq(arr anyarray [, ...]) → anyarray

arrayJoin(arr anyarray) → any

arrayDifference(array anyarray) → anyarray

arrayDistinct(array anyarray) → anyarray

arrayEnumerateDense(arr anyarray) → anyarray

arrayIntersect(arr anyarray) → anyarray

arrayJaccardIndex(anyarray, anyarray) → numeric

arrayReverse(arr anyarray) → anyarray

reverse(arr anyarray) → anyarray

arrayFlatten(array_of_arrays anyarray) → anyarray

arrayCompact(arr anyarray) → anyarray

arrayZip(arr anyarray [, ...]) → anyarray

arrayAUC(arr_scores anyarray, arr_labels anyarray) → numeric

arrayProduct(arr anyarray) → float64

arrayRotateLeft(arr anyarray, n integer) → anyarray

arrayRotateRight(arr anyarray, n integer) → anyarray

arrayShiftLeft(arr anyarray, n integer [, default any]) → anyarray

arrayShiftRight(arr anyarray, n integer [, default any]) → anyarray

arrayRandomSample(arr anyarray, samples integer) → anyarray

Bit Functions

FunctionSupported

bitAnd(numeric, numeric) → integer

bitOr(numeric, numeric) → integer

bitXor(numeric, numeric) → integer

bitNot(numeric) → integer

bitShiftLeft(numeric, integer) → integer

bitShiftLeft(text, integer) → text

bitShiftRight(numeric, integer) → integer

bitShiftRight(text, integer) → text

bitRotateLeft(numeric, integer) → integer

bitRotateRight(numeric, integer) → integer

bitSlice(s text, offset integer [, length integer]) → text

byteSlice(s text, offset integer [, length integer]) → text

bitTest(numeric, integer) → boolean

bitTestAll(numeric, integer [, ...]) → boolean

bitTestAny(numeric, integer [, ...]) → boolean

bitCount(numeric) → uint8

bitHammingDistance(int64, int64) → uint8

Comparison Functions

FunctionSupported

equals(any, any) → boolean

notEquals(any, any) → boolean

less(any, any) → boolean

greater(any, any) → boolean

lessOrEquals(any, any) → boolean

greaterOrEquals(any, any) → boolean

Conditional Functions

FunctionSupported

if(cond boolean, then any, else any) → any

multiIf(cond_1 boolean, then_1 any, cond_2 boolean, then_2 any [, ...], else any) → any

greatest(any [, ...]) → any

least(any [, ...]) → any

Date and Time Functions

FunctionSupported

makeDate(year numeric, month numeric, day numeric) → date

makeDate(year numeric, day_of_year numeric) → date

makeDate32(year numeric, month numeric, day numeric) → date32

makeDate32(year numeric, day_of_year numeric) → date32

makeDateTime(year numeric, month numeric, day numeric, hour numeric, minute numeric, second numeric [, timezone text]) → date32

makeDateTime64(year numeric, month numeric, day numeric, hour numeric, minute numeric, second numeric [, fraction numeric] [, precision numeric] [, timezone text]) → date32

timestamp(exp text [, expr_time text]) → datetime64

timeZone() → text

timezone() → text

serverTimeZone() → text

serverTimezone() → text

toTimeZone(datetime64, timezone text) → datetime

timeZoneOf(date time or datetime64) → text

timeZoneOffset(date time or datetime64) → int32

toYear(date or date32 or datetime or datetime64) → uint16

toQuarter(date or date32 or datetime or datetime64) → uint8

toMonth(date or date32 or datetime or datetime64) → uint8

toDayOfYear(date or date32 or datetime or datetime64) → uint16

DAYOFYEAR(date or date32 or datetime or datetime64) → uint16

toDayOfMonth(date or date32 or datetime or datetime64) → uint8

toDayOfWeek(date or date32 or datetime or datetime64 [, mode integer] [, timezone text]) → uint8

toHour(date time or datetime64) → uint8

HOUR(date time or datetime64) → uint8

toMinute(date time or datetime64) → uint8

MINUTE(date time or datetime64) → uint8

toSecond(date time or datetime64) → uint8

SECOND(date time or datetime64) → uint8

toMillisecond(date time or datetime64) → uint8

MILLISECOND(date time or datetime64) → uint8

toUnixTimestamp(date or timestamp) → uint32

toUnixTimestamp(str text [, timezone text]) → uint32

toStartOfYear(date or date32 or datetime or datetime64) → date

toStartOfISOYear(date or date32 or datetime or datetime64) → date

toStartOfQuarter(date or date32 or datetime or datetime64) → date

toStartOfMonth(date or date32 or datetime or datetime64) → date

toLastDayOfMonth(date or date32 or datetime or datetime64) → date

toMonday(date or date32 or datetime or datetime64) → date

toStartOfWeek(date or date32 or datetime or datetime64 [, mode integer] [, timezone text]) → date

toLastDayOfWeek(date or date32 or datetime or datetime64 [, mode integer] [, timezone text]) → date

toStartOfDay(date or date32 or datetime or datetime64) → datetime

toStartOfHour(date time or datetime64) → datetime

toStartOfMinute(date time or datetime64) → datetime

toStartOfSecond(datetime64 [, timezone text]) → datetime64

toStartOfFiveMinutes(date time or datetime64) → datetime

toStartOfTenMinutes(date time or datetime64) → datetime

toStartOfFifteenMinutes(date time or datetime64) → datetime

toTime(date time or datetime64) → same as input type

toRelativeYearNum(date or date32 or datetime or datetime64) → integer

toRelativeQuarterNum(date or date32 or datetime or datetime64) → integer

toRelativeMonthNum(date or date32 or datetime or datetime64) → integer

toRelativeWeekNum(date or date32 or datetime or datetime64) → integer

toRelativeDayNum(date or date32 or datetime or datetime64) → integer

toRelativeHourNum(date or date32 or datetime or datetime64) → integer

toRelativeMinuteNum(date or date32 or datetime or datetime64) → integer

toRelativeSecondNum(date or date32 or datetime or datetime64) → integer

toISOYear(date or date32 or datetime or datetime64) → uint16

toISOWeek(date or date32 or datetime or datetime64) → uint8

toWeek(text or date or date32 or datetime or datetime64 [, mode integer]) → uint8

WEEK(text or date or date32 or datetime or datetime64 [, mode integer]) → uint8

toYearWeek(text or date or date32 or datetime or datetime64 [, mode integer]) → uint8

YEARWEEK(text or date or date32 or datetime or datetime64 [, mode integer]) → uint8

toDaysSinceYearZero(date or date32 or datetime or datetime64 [, timezone text]) → uint32

TO_DAYS(date or date32 or datetime or datetime64 [, timezone text]) → uint32

fromDaysSinceYearZero(days integer) → date

FROM_DAYS(days integer) → date

fromDaysSinceYearZero32(days integer) → date32

age(unit text, startdate date or date32 or datetime or datetime64, enddate date or date32 or datetime or datetime64 [, timezone text]) → integer

date_diff(unit text, startdate date or date32 or datetime or datetime64, enddate date or date32 or datetime or datetime64 [, timezone text]) → integer

dateDiff(unit text, startdate date or date32 or datetime or datetime64, enddate date or date32 or datetime or datetime64 [, timezone text]) → integer

DATE_DIFF(unit text, startdate date or date32 or datetime or datetime64, enddate date or date32 or datetime or datetime64 [, timezone text]) → integer

timestampDiff(unit text, startdate date or date32 or datetime or datetime64, enddate date or date32 or datetime or datetime64 [, timezone text]) → integer

timestamp_diff(unit text, startdate date or date32 or datetime or datetime64, enddate date or date32 or datetime or datetime64 [, timezone text]) → integer

TIMESTAMP_DIFF(unit text, startdate date or date32 or datetime or datetime64, enddate date or date32 or datetime or datetime64 [, timezone text]) → integer

date_trunc(unit text, value date or date32 or datetime or datetime64 [, timezone text]) → timestamp

dateTrunc(unit text, value date or date32 or datetime or datetime64 [, timezone text]) → timestamp

date_add(unit text, value integer, date date or date32 or datetime or datetime64) → date or date32 or datetime or datetime64

dateAdd(unit text, value integer, date date or date32 or datetime or datetime64) → date or date32 or datetime or datetime64

DATE_ADD(unit text, value integer, date date or date32 or datetime or datetime64) → date or date32 or datetime or datetime64

date_sub(unit text, value integer, date date or date32 or datetime or datetime64) → date or date32 or datetime or datetime64

dateSub(unit text, value integer, date date or date32 or datetime or datetime64) → date or date32 or datetime or datetime64

DATE_SUB(unit text, value integer, date date or date32 or datetime or datetime64) → date or date32 or datetime or datetime64

timestamp_sub(unit text, value integer, date date or date32 or datetime or datetime64) → date or date32 or datetime or datetime64

timestampSub(unit text, value integer, date date or date32 or datetime or datetime64) → date or date32 or datetime or datetime64

TIMESTAMP_SUB(unit text, value integer, date date or date32 or datetime or datetime64) → date or date32 or datetime or datetime64

addDate(date date or date32 or datetime or datetime64, interval interval) → date or date32 or datetime or datetime64

subDate(date date or date32 or datetime or datetime64, interval interval) → date or date32 or datetime or datetime64

now(timezone text) → datetime

current_timestamp(timezone text) → timestamp

now64(timezone text) → datetime64

nowInBlock(timezone text) → datetime

today() → datetime

yesterday() → datetime

timeSlot(date time or datetime64) → same as input type

toYYYYMM(date or date32 or datetime or datetime64 [, timezone text]) → text

toYYYYMMDD(date or date32 or datetime or datetime64 [, timezone text]) → text

toYYYYMMDDhhmmss(date or date32 or datetime or datetime64 [, timezone text]) → text

YYYYMMDDToDate(yyyymmdd text) → date

YYYYMMDDToDate32(yyyymmdd text) → date32

YYYYMMDDhhmmssToDateTime(yyyymmddhhmmss text [, timezone text]) → datetime

YYYYMMDDhhmmssToDateTime64(yyyymmddhhmmss text [, timezone text]) → datetime64

addYears(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

addQuarters(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

addMonths(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

addWeeks(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

addDays(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

addHours(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

addMinutes(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

addSeconds(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

addMilliseconds(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

addMicroseconds(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

addNanoseconds(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

subtractYears(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

subtractQuarters(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

subtractMonths(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

subtractWeeks(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

subtractDays(text or date or date32 or datetime or datetime64, integer) → date or date32 or datetime or datetime64

subtractHours(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

subtractMinutes(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

subtractSeconds(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

subtractMilliseconds(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

subtractMicroseconds(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

subtractNanoseconds(text or date or date32 or datetime or datetime64, integer) → datetime or datetime64

timeSlots(starttime datetime or datetime64, duration uint32 [, size uint32]) → anyarray

formatDateTime(date or date32 or datetime or datetime64, format text [, timezone text]) → text

DATE_FORMAT(date or date32 or datetime or datetime64, format text [, timezone text]) → text

formatDateTimeInJodaSyntax(date or date32 or datetime or datetime64, format text [, timezone text]) → text

dateName(date_part text, date date or date32 or datetime or datetime64 [, timezone text]) → text

monthName(date or date32 or datetime or datetime64) → text

fromUnixTimestamp(integer) → datetime

fromUnixTimestamp(integer or date or date32 or datetime or datetime64, format text [, timezone text]) → text

FROM_UNIXTIME(integer) → datetime

fromUnixTimestampInJodaSyntax(integer or date or date32 or datetime or datetime64, format text [, timezone text]) → text

toModifiedJulianDay(text) → int32

toModifiedJulianDayOrNull(text) → int32

fromModifiedJulianDay(integer) → text

fromModifiedJulianDayOrNull(integer) → text

toUTCTimestamp(time_val datetime or datetime64, timezone text) → text

fromUTCTimestamp(time_val datetime or datetime64, timezone text) → text

timeDiff(first_datetime datetime or datetime64, second_datetime datetime or datetime64) → numeric

Encoding Functions

FunctionSupported

char(numeric [, ...]) → text

hex(any) → text

unhex(arg text) → text

bin(any) → text

unbin(text) → text

bitmaskToList(integer) → text

bitmaskToArray(integer) → anyarray

⌛️

bitPositionsToArray(integer) → anyarray

⌛️

mortonEncode(integer [, ...]) → uint64

Geo: Coordinate Functions

FunctionSupported

greatCircleDistance(lon1Deg Float64, lat1Deg Float64, lon2Deg Float64, lat2Deg Float64) → Float64

geoDistance(lon1Deg Float64, lat1Deg Float64, lon2Deg Float64, lat2Deg Float64) → Float64

greatCircleAngle(lon1Deg Float64, lat1Deg Float64, lon2Deg Float64, lat2Deg Float64) → Float64

pointInEllipses(x Float64, y Float64, xi Float64, yi Float64, ai Float64, bi Float64 [, ...]) → UInt8

pointInPolygon(point Point, polygon Polygon) → UInt8

Geo: Geohash Functions

FunctionSupported

geohashEncode(longitude Float64, latitude Float64 [, precision UInt8]) → String

geohashDecode(encoded String) → Point

geohashesInBox(longitude_min Float64, latitude_min Float64, longitude_max Float64, latitude_max Float64, precision UInt8) → Array(String)

Geo: H3 Index Functions

FunctionSupported

h3IsValid(h3index UInt64) → UInt8

h3GetResolution(h3index UInt64) → UInt8

h3GetResolution(h3index UInt64) → UInt8

h3EdgeAngle(resolution UInt8) → Float64

h3EdgeLengthM(resolution UInt8) → Float64

h3EdgeLengthKm(resolution UInt8) → Float64

geoToH3(lon Float64, lat Float64, resolution UInt8) → UInt64

h3ToGeo(h3index UInt64) → Point

h3ToGeoBoundary(h3index UInt64) → Ring

h3kRing(h3index UInt64, k integer) → Array(UInt64)

h3GetBaseCell(h3index UInt64) → UInt8

h3HexAreaM2(resolution UInt8) → Float64

h3HexAreaKm2(resolution UInt8) → Float64

h3IndexesAreNeighbors(h3index1 UInt64, h3index2 UInt64) → UInt8

h3ToChildren(h3index UInt64, resolution UInt8) → Array(UInt64)

h3ToParent(h3index UInt64, resolution UInt8) → UInt64

h3ToString(h3index UInt64) → String

stringToH3(index_str String) → UInt64

h3IsResClassIII(h3index UInt64) → UInt8

h3IsPentagon(h3index UInt64) → UInt8

h3GetFaces(h3index UInt64) → Array(UInt64)

h3CellAreaM2(h3index UInt64) → Float64

h3CellAreaRads2(h3index UInt64) → Float64

h3ToCenterChild(h3index UInt64, resolution UInt8) → UInt64

h3ExactEdgeLengthM(h3index UInt64) → Float64

h3ExactEdgeLengthKm(h3index UInt64) → Float64

h3ExactEdgeLengthRads(h3index UInt64) → Float64

h3NumHexagons(resolution UInt8) → Int64

h3PointDistM(lat1 Float64, lon1 Float64, lat2 Float64, lon2 Float64) → Float64

h3PointDistKm(lat1 Float64, lon1 Float64, lat2 Float64, lon2 Float64) → Float64

h3PointDistRads(lat1 Float64, lon1 Float64, lat2 Float64, lon2 Float64) → Float64

h3GetRes0Indexes() → Array(UInt64)

h3GetPentagonIndexes(resolution UInt8) → Array(UInt64)

h3Line(start UInt64, end UInt64) → Array(UInt64)

h3Distance(start UInt64, end UInt64) → Int64

h3HexRing(h3index UInt64, k UInt64) → Array(UInt64)

h3GetUnidirectionalEdge(originIndex UInt64, destinationIndex UInt64) → UInt64

h3UnidirectionalEdgeIsValid(h3index UInt64) → UInt8

h3GetOriginIndexFromUnidirectionalEdge(edge UInt64) → UInt64

h3GetDestinationIndexFromUnidirectionalEdge(edge UInt64) → UInt64

h3GetIndexesFromUnidirectionalEdge(edge UInt64) → (UInt64, UInt64)

h3GetUnidirectionalEdgesFromHexagon(h3index UInt64) → Array(UInt64)

h3GetUnidirectionalEdgeBoundary(h3index UInt64) → Array(Point)

Geo: S2 Geometry Functions

FunctionSupported

geoToS2(lon Float64, lat Float64) → UInt64

s2ToGeo(s2Index UInt64) → Point

s2GetNeighbors(s2Index UInt64) → Array(UInt64)

s2CellsIntersect(s2Index1 UInt64, s2Index2 UInt64) → UInt8

s2CapContains(center UInt64, degrees Float64, point UInt64) → UInt8

s2CapUnion(center1 UInt64, center2 UInt64, radius1 Float64, radius2 Float64) → (UInt64, Float64)

s2RectAdd(s2pointLow UInt64, s2pointHigh UInt64, s2Point UInt64) → (UInt64, UInt64)

s2RectContains(s2PointLow UInt64, s2PointHigh UInt64, s2Point UInt64) → UInt8

s2RectUnion(s2Rect1PointLow UInt64, s2Rect1PointHi UInt64, s2Rect2PointLow UInt64, s2Rect2PointHi UInt64) → (UInt64, UInt64)

s2RectIntersection(s2Rect1PointLow UInt64, s2Rect1PointHi UInt64, s2Rect2PointLow UInt64, s2Rect2PointHi UInt64) → (UInt64, UInt64)

Geo: Polygon Functions

FunctionSupported

wkt(geo_data Point) → String

wkt(geo_data Ring) → String

wkt(geo_data Polygon) → String

wkt(geo_data MultiPolygon) → String

readWKTMultiPolygon(wkt_string String) → MultiPolygon

readWKTPolygon(wkt_string String) → Polygon

readWKTPoint(wkt_string String) → Point

readWKTLineString(wkt_string String) → Ring

readWKTRing(wkt_string String) → Ring

polygonsWithinSpherical(polygon_a Polygon, polygon_b Polygon) → UInt8

polygonsDistanceSpherical(polygon_a Polygon, polygon_b Polygon) → Float64

polygonsDistanceCartesian(polygon_a Polygon, polygon_b Polygon) → Float64

polygonsEqualsCartesian(polygon_a Polygon, polygon_b Polygon) → UInt8

polygonsSymDifferenceSpherical(polygon_a Polygon, polygon_b Polygon) → MultiPolygon

polygonsSymDifferenceCartesian(polygon_a Polygon, polygon_b Polygon) → MultiPolygon

polygonsIntersectionSpherical(polygon_a Polygon, polygon_b Polygon) → MultiPolygon

polygonsWithinCartesian(polygon_a Polygon, polygon_b Polygon) → UInt8

polygonConvexHullCartesian(MultiPolygon) → Polygon

polygonAreaSpherical(Polygon) → Float64

polygonsUnionSpherical(polygon_a Polygon, polygon_b Polygon) → MultiPolygon

polygonPerimeterSpherical(Polygon) → Float64

polygonsIntersectionCartesian(polygon_a Polygon, polygon_b Polygon) → MultiPolygon

polygonAreaCartesian(Polygon) → Float64

polygonPerimeterCartesian(Polygon) → Float64

polygonsUnionCartesian(polygon_a Polygon, polygon_b Polygon) → MultiPolygon

Geo: SVG Functions

FunctionSupported

Svg(geometry Point [, style String]) → String

Svg(geometry Ring [, style String]) → String

Svg(geometry Polygon [, style String]) → String

Svg(geometry MultiPolygon [, style String]) → String

Hash Functions

FunctionSupported

halfMD5(any [, ...]) → uint64

MD4(text) → text

MD5(text) → text

sipHash64(any [, ...]) → uint64

sipHash128(any [, ...]) → text

sipHash128Reference(any [, ...]) → text

cityHash(any [, ...]) → uint64

intHash32(integer) → uint32

intHash64(integer) → uint64

SHA1(text) → text

SHA224(text) → text

SHA256(text) → text

SHA512(text) → text

SHA512_256(text) → text

BLAKE3(text) → text

URLHash(url text [, N integer]) → text

farmFingerprint64(any [, ...]) → uint64

farmHash64(any [, ...]) → uint64

javaHash(any) → int32

javaHashUTF16LE(text) → int32

hiveHash(text) → int32

metroHash64(any [, ...]) → uint64

jumpConsistentHash(u int64, buckets integer) → int32

murmurHash2_32(any [, ...]) → uint32

murmurHash2_64(any [, ...]) → uint64

gccMurmurHash(any [, ...]) → uint64

kafkaMurmurHash(any [, ...]) → uint32

murmurHash3_32(any [, ...]) → uint32

murmurHash3_64(any [, ...]) → uint64

murmurHash3_128(any [, ...]) → text

xxh3(any [, ...]) → uint64

xxHash32(text) → uint32

xxHash64(text) → uint64

ngramSimHash(text [, ngramsize uint8]) → uint64

ngramSimHashCaseInsensitive(text [, ngramsize uint8]) → uint64

ngramSimHashUTF8(text [, ngramsize uint8]) → uint64

ngramSimHashCaseInsensitiveUTF8(text [, ngramsize uint8]) → uint64

wordShingleSimHash(text [, shinglesize uint8]) → uint64

wordShingleSimHashCaseInsensitive(text [, shinglesize uint8]) → uint64

wordShingleSimHashUTF8(text [, shinglesize uint8]) → uint64

wordShingleSimHashCaseInsensitiveUTF8(text [, shinglesize uint8]) → uint64

sqidEncode(integer [, ...]) → text

sqidDecode(text) → anyarray

IP Address Functions

FunctionSupported

IPv4NumToString(uint32) → text

IPv4StringToNum(text) → uint32

INET_ATON(text) → uint32

IPv4StringToNumOrDefault(text) → uint32

IPv4StringToNumOrNull(text) → uint32

IPv4NumToStringClassC(uint32) → text

IPv6NumToString(text) → text

INET6_NTOA(text) → text

IPv6StringToNum(text) → text

INET6_ATON(text) → text

IPv6StringToNumOrDefault(text) → text

IPv6StringToNumOrNull(text) → text

IPv4ToIPv6(uint32) → text

cutIPv6(text, bytesToCutForIPv6 integer, bytesToCutForIPv4 integer) → text

isIPv4String(text) → boolean

isIPv6String(text) → boolean

isIPAddressInRange(address text, prefix text) → boolean

JSON Functions

FunctionSupported

simpleJSONHas(json String, field_name String) → UInt8

visitParamHas(json String, field_name String) → UInt8

simpleJSONExtractUInt(json String, field_name String) → UInt64

simpleParamExtractUInt(json String, field_name String) → UInt64

simpleJSONExtractInt(json String, field_name String) → Int64

simpleParamExtractInt(json String, field_name String) → Int64

simpleJSONExtractFloat(json String, field_name String) → Float64

simpleParamExtractFloat(json String, field_name String) → Float64

simpleJSONExtractBool(json String, field_name String) → UInt8

simpleJSONExtractRaw(json String, field_name String) → String

simpleParamExtractRaw(json String, field_name String) → String

simpleJSONExtractString(json String, field_name String) → String

simpleParamExtractString(json String, field_name String) → String

isValidJSON(json String) → UInt8

JSONHas(json String [, indices_or_keys String or integer [, ...]]) → UInt8

JSONLength(json String [, indices_or_keys String or integer [, ...]]) → UInt64

JSONType(json String [, indices_or_keys String or integer [, ...]]) → String

JSONExtractUInt(json String [, indices_or_keys String or integer [, ...]]) → UInt64

JSONExtractInt(json String [, indices_or_keys String or integer [, ...]]) → Int64

JSONExtractFloat(json String [, indices_or_keys String or integer [, ...]]) → Float64

JSONExtractString(json String [, indices_or_keys String or integer [, ...]]) → String

JSONExtract(json String [, indices_or_keys String or integer [, ...]], return_type String) → any

JSONExtractKeys(json String [, indices_or_keys String or integer [, ...]]) → Array(String)

JSONExtractRaw(json String [, indices_or_keys String or integer [, ...]]) → String

JSONExtractArrayRaw(json String [, indices_or_keys String or integer [, ...]]) → Array(String)

JSONArrayLength(json String) → Nullable(UInt64)

JSONArrayLength(json String) → Nullable(UInt64)

JSON_EXISTS(json String, path String) → UInt8

JSON_QUERY(json String, path String) → String

JSON_VALUE(json String, path String) → String

toJSONString(value any) → String

jsonMergePatch(json1 String [, json2 String [, ...]]) → String

Logical Functions

FunctionSupported

and(any, any [, ...]) → boolean

or(any, any [, ...]) → boolean

not(any) → boolean

xor(any, any [, ...]) → boolean

Mathematical Functions

FunctionSupported

e() → float64

pi() → float64

exp(numeric) → float32 or float64

log(numeric) → float32 or float64

ln(numeric) → float32 or float64

exp2(numeric) → float32 or float64

intExp2(numeric) → uint64

log2(numeric) → float32 or float64

exp10(numeric) → float32 or float64

intExp10(numeric) → uint64

log10(numeric) → float32 or float64

sqrt(numeric) → float32 or float64

cbrt(numeric) → float32 or float64

erf(numeric) → float32 or float64

erfc(numeric) → float32 or float64

lgamma(numeric) → float32 or float64

tgamma(numeric) → float32 or float64

sin(numeric) → float32 or float64

cos(numeric) → float32 or float64

tan(numeric) → float32 or float64

asin(numeric) → float32 or float64

acos(numeric) → float32 or float64

atan(numeric) → float32 or float64

pow(numeric, numeric) → float64

cosh(float64) → float64

acosh(float64) → float64

sinh(float64) → float64

asinh(float64) → float64

atanh(float64) → float64

atan2(float64, float64) → float64

hypot(float64, float64) → float64

log1p(float64) → float64

sign(numeric) → int8

degrees(float64) → float64

radians(float64) → float64

factorial(integer) → uint64

width_bucket(operand numeric, low numeric, high numeric, count uint8 or uint16 or uint32 or uint64) → numeric

Nullable Value Functions

FunctionSupported

isNull(any) → boolean

isNotNull(any) → boolean

isZeroOrNull(any) → boolean

coalesce(any [, ...]) → any

ifNull(x any, alt any) → any

nullIf(x any, y any) → any

assumeNotNull(x any) → any

toNullable(x any) → any

Other Functions

FunctionSupported

hostName() → text

⌛️

getMacro(text) → text

⌛️

FQDN() → text

⌛️

basename(text) → text

visibleWidth(text) → text

toTypeName(text) → text

blockSize() → integer

byteSize(any [, ...]) → uint64

materialize(any) → any

⌛️

ignore(any [, ...]) → any

⌛️

sleep(seconds numeric) → any

⌛️

sleepEachRow(seconds numeric) → any

⌛️

currentDatabase() → text

currentUser() → text

⌛️

user() → text

⌛️

USER() → text

⌛️

current_user() → text

⌛️

isConstant(any) → boolean

isFinite(float32 or float64) → boolean

isInfinite(float32 or float64) → boolean

ifNotFinite(x float32 or float64, y float32 or float64) → float32 or float64

isNaN(float32 or float64) → boolean

hasThreadFuzzer() → boolean

⌛️

bar(x integer, min int64, max int64, width numeric) → text

transform(x any, array_from anyarray, array_to anyarray [, default any]) → any

⌛️

formatReadableDecimalSize(bytes integer) → text

formatReadableSize(bytes integer) → text

formatReadableQuantity(quantity integer) → text

formatReadableTimeDelta(column any [, maximum_unit text] [, minimum_unit text]) → text

parseTimeDelta(text) → float64

least(any, any) → any

greatest(any, any) → any

uptime() → integer

⌛️

version() → text

buildId() → text

⌛️

blockNumber() → text

rowNumberInBlock() → integer

rowNumberInAllBlocks() → integer

neighbor(column any, offset integer [, default_value any]) → any

⌛️

runningDifference(numeric) → numeric

runningDifferenceWithFirstValue(numeric) → numeric

runningConcurrency(start date or date32 or datetime or datetime64, end date or date32 or datetime or datetime64) → uint32

⌛️

MACNumToString(uint64) → text

⌛️

MACStringToNum(text) → uint64

⌛️

MACStringToOUI(text) → uint64

⌛️

getSizeOfEnumType(any) → integer

⌛️

blockSerializedSize(any [, ...]) → integer

⌛️

toColumnTypeName(any) → text

⌛️

dumpColumnStructure(any) → text

⌛️

defaultValueOfArgumentType(any) → any

⌛️

defaultValueOfTypeName(text) → any

⌛️

indexHint(any) → uint8

⌛️

replicate(any, anyarray) → anyarray

⌛️

filesystemAvailable() → uint64

⌛️

filesystemFree() → uint64

⌛️

filesystemCapacity() → uint64

⌛️

initializeAggregation(aggregate_function text [, arg any [, ...]]) → any

⌛️

finalizeAggregation(state any) → any

⌛️

runningAccumulate(agg_state any [, grouping any]) → any

⌛️

joinGet(join_storage_table_name any, value_column text, join_keys anyarray) → any

⌛️

catboostEvaluate(path_to_model text, feature text [, ...]) → any

⌛️

throwIf(x any [, message text] [, error_code integer]) → any

⌛️

identity(any) → any

getSetting(text) → any

⌛️

isDecimalOverflow(d decimal [, p uint8]) → boolean

⌛️

countDigits(x integer) → uint8

errorCodeToName(integer) → text

⌛️

tcpPort() → uint16

⌛️

currentProfiles() → anyarray

⌛️

enabledProfiles() → anyarray

⌛️

defaultProfiles() → anyarray

⌛️

currentRoles() → anyarray

⌛️

enabledRoles() → anyarray

⌛️

defaultRoles() → anyarray

⌛️

getServerPort(port_name text) → uint16

⌛️

queryID() → text

⌛️

initialQueryID() → text

⌛️

shardNum() → uint32

⌛️

shardCount() → uint32

⌛️

getOSKernelVersion() → text

⌛️

zookeeperSessionUptime() → uint32

⌛️

generateRandomStructure(number_of_columns integer [, seed integer]) → any

⌛️

structureToCapnProtoSchema(structure any [, root_struct_name text]) → text

⌛️

structureToProtobufSchema(structure any [, root_struct_name text]) → text

⌛️

formatQuery(query text) → text

formatQueryOrNull(query text) → text

formatQuerySingleLine(query text) → text

formatQuerySingleLineOrNull(query text) → text

variantElement(variant any, type_name text [, default_value any]) → any

⌛️

variantType(variant any) → text

⌛️

getClientHTTPHeader(text) → text

⌛️

Random Value Functions

FunctionSupported

rand() → uint32

rand64() → uint64

randCanonical() → float64

randConstant(any) → uint32

randUniform(min float64, max float64) → float64

randNormal(mean float64, variance float64) → float64

randLogNormal(mean float64, variance float64) → float64

randBinomial(experiments uint64, probability float64) → uint64

randNegativeBinomial(experiments uint64, probability float64) → uint64

randPoisson(n uint64) → uint64

randBernoulli(probability float64) → uint64

randExponential(lambda float64) → float64

randChiSquared(degree_of_freedom float64) → float64

randStudentT(degree_of_freedom float64) → float64

randFisherF(d1 float64, d2 float64) → float64

randomString(length integer) → text

randomFixedString(length uint64) → text

randomPrintableASCII(length integer) → text

randomStringUTF8(length uint64) → text

fuzzBits(s text, prob float32 or float64) → text

Rounding Functions

FunctionSupported

floor(x numeric [, N integer]) → numeric

ceil(x numeric [, N integer]) → numeric

ceiling(x numeric [, N integer]) → numeric

trunc(x numeric [, N integer]) → numeric

truncate(x numeric [, N integer]) → numeric

round(x numeric [, N integer]) → numeric

roundBankers(x numeric [, N integer]) → numeric

roundToExp2(numeric) → numeric

roundDuration(numeric) → numeric

roundAge(numeric) → numeric

roundDown(numeric, anyarray) → any

String Functions

FunctionSupported

empty(text) → boolean

empty(anyarray) → boolean

empty(uuid) → boolean

notEmpty(text) → boolean

notEmpty(anyarray) → boolean

notEmpty(uuid) → boolean

length(text) → integer

length(anyarray) → integer

OCTET_LENGTH(text) → integer

lengthUTF8(text) → integer

CHAR_LENGTH(text) → integer

CHARACTER_LENGTH(text) → integer

leftPad(text, length integer [, pad_string text]) → text

LPAD(text, length integer [, pad_string text]) → text

leftPadUTF8(text, length integer [, pad_string text]) → text

rightPad(text, length integer [, pad_string text]) → text

RPAD(text, length integer [, pad_string text]) → text

rightPadUTF8(text, length integer [, pad_string text]) → text

lower(text) → text

lcase(text) → text

upper(text) → text

ucase(text) → text

lowerUTF8(text) → text

upperUTF8(text) → text

isValidUTF8(text) → boolean

toValidUTF8(text) → text

repeat(text, integer) → text

space(integer) → text

SPACE(integer) → text

reverse(text) → text

reverseUTF8(text) → text

concat(s1 text, s2 text [, ...]) → text

concatAssumeInjective(s1 text, s2 text [, ...]) → text

concatWithSeparator(sep text, expr1 text, expr2 text [, ...]) → text

concat_ws(sep text, expr1 text, expr2 text [, ...]) → text

concatWithSeparatorAssumeInjective(sep text, expr1 text, expr2 text [, ...]) → text

substring(s text, offset integer [, length integer]) → text

substr(s text, offset integer [, length integer]) → text

mid(s text, offset integer [, length integer]) → text

byteSlice(s text, offset integer [, length integer]) → text

substringUTF8(s text, offset integer [, length integer]) → text

substringIndex(s text, delim text, count integer) → text

SUBSTRING_INDEX(s text, delim text, count integer) → text

substringIndexUTF8(s text, delim text, count integer) → text

appendTrailingCharIfAbsent(s text, c text) → text

convertCharset(s text, from text, to text) → text

base58Encode(text) → text

base58Decode(text) → text

tryBase58Decode(text) → text

base64Encode(text) → text

TO_BASE64(text) → text

base64Decode(text) → text

FROM_BASE64(text) → text

tryBase64Decode(text) → text

endsWith(str text, suffix text) → boolean

endsWithUTF8(str text, suffix text) → boolean

startsWith(str text, prefix text) → boolean

startsWithUTF8(str text, prefix text) → boolean

trimLeft(text) → text

ltrim(text) → text

trimRight(text) → text

rtrim(text) → text

trimBoth(text) → text

trim(text) → text

CRC32(text) → uint32

CRC32IEEE(text) → uint32

CRC64(text) → uint64

normalizeQuery(text) → text

normalizeQueryHash(text) → uint64

normalizeUTF8NFC(text) → text

normalizeUTF8NFD(text) → text

normalizeUTF8NFKC(text) → text

normalizeUTF8NFKD(text) → text

encodeXMLComponent(text) → text

decodeXMLComponent(text) → text

decodeHTMLComponent(text) → text

extractTextFromHTML(text) → text

ascii(text) → int32

soundex(text) → text

punycodeEncode(text) → text

punycodDecode(text) → text

tryPunycodDecode(text) → text

idnaEncode(text) → text

tryIdnaEncode(text) → text

idnaDecode(text) → text

byteHammingDistance(string1 text, string2 text) → integer

mismatches(string1 text, string2 text) → integer

stringJaccardIndex(string1 text, string2 text) → float64

stringJaccardIndexUTF8(string1 text, string2 text) → float64

editDistance(string1 text, string2 text) → integer

levenshteinDistance(string1 text, string2 text) → integer

damerauLevenshteinDistance(string1 text, string2 text) → integer

jaroSimilarity(string1 text, string2 text) → float64

jaroWinklerSimilarity(string1 text, string2 text) → float64

initcap(text) → text

initcapUTF8(text) → text

firstLine(text) → text

String Replacement Functions

FunctionSupported

replaceOne(haystack text, pattern text, replacement text) → text

replaceAll(haystack text, pattern text, replacement text) → text

replace(haystack text, pattern text, replacement text) → text

replaceRegexpOne(haystack text, pattern text, replacement text) → text

replaceRegexpAll(haystack text, pattern text, replacement text) → text

REGEXP_REPLACE(haystack text, pattern text, replacement text) → text

regexpQuoteMeta(text) → text

format(pattern text, s text [, ...]) → text

translate(s text, from text, to text) → text

translateUTF8(s text, from text, to text) → text

Type Conversion Functions

FunctionSupported

toInt8(numeric or String) → Int8

toInt16(numeric or String) → Int16

toInt32(numeric or String) → Int32

toInt64(numeric or String) → Int64

toInt128(numeric or String) → Int128

toInt256(numeric or String) → Int256

toInt8OrZero(numeric or String) → Int8

toInt16OrZero(numeric or String) → Int16

toInt32OrZero(numeric or String) → Int32

toInt64OrZero(numeric or String) → Int64

toInt128OrZero(numeric or String) → Int128

toInt256OrZero(numeric or String) → Int256

toInt8OrNull(numeric or String) → Int8

toInt16OrNull(numeric or String) → Int16

toInt32OrNull(numeric or String) → Int32

toInt64OrNull(numeric or String) → Int64

toInt128OrNull(numeric or String) → Int128

toInt256OrNull(numeric or String) → Int256

toInt8OrDefault(numeric or String, Int8) → Int8

toInt16OrDefault(numeric or String, Int16) → Int16

toInt32OrDefault(numeric or String, Int32) → Int32

toInt64OrDefault(numeric or String, Int64) → Int64

toInt128OrDefault(numeric or String, Int128) → Int128

toInt256OrDefault(numeric or String, Int256) → Int256

toUInt8(numeric or String) → UInt8

toUInt16(numeric or String) → UInt16

toUInt32(numeric or String) → UInt32

toUInt64(numeric or String) → UInt64

toUInt128(numeric or String) → UInt128

toUInt256(numeric or String) → UInt256

toUInt8OrZero(numeric or String) → UInt8

toUInt16OrZero(numeric or String) → UInt16

toUInt32OrZero(numeric or String) → UInt32

toUInt64OrZero(numeric or String) → UInt64

toUInt128OrZero(numeric or String) → UInt128

toUInt256OrZero(numeric or String) → UInt256

toUInt8OrNull(numeric or String) → UInt8

toUInt16OrNull(numeric or String) → UInt16

toUInt32OrNull(numeric or String) → UInt32

toUInt64OrNull(numeric or String) → UInt64

toUInt128OrNull(numeric or String) → UInt128

toUInt256OrNull(numeric or String) → UInt256

toUInt8OrDefault(numeric or String, U Int8) → UInt8

toUInt16OrDefault(numeric or String, UInt16) → UInt16

toUInt32OrDefault(numeric or String, UInt32) → UInt32

toUInt64OrDefault(numeric or String, UInt64) → UInt64

toUInt128OrDefault(numeric or String, U Int128) → UInt128

toUInt256OrDefault(numeric or String, U Int256) → UInt256

toFloat32(numeric or String) → Float32

toFloat64(numeric or String) → Float64

toFloat32OrZero(numeric or String) → Float32

toFloat64OrZero(numeric or String) → Float64

toFloat32OrNull(numeric or String) → Float32

toFloat64OrNull(numeric or String) → Float64

toFloat32OrDefault(numeric or String, Float32) → Float32

toFloat64OrDefault(numeric or String, Float64) → Float64

toDate(any) → Date

toDateOrZero(any) → Date

toDateOrNull(any) → Date

toDateOrDefault(any [, Date]) → Date

toDateTime(any [, timezone text]) → DateTime

toDateTimeOrZero(any [, timezone text]) → DateTime

toDateTimeOrNull(any [, timezone text]) → DateTime

toDateTimeOrDefault(any [, timezone text] [, DateTime]) → DateTime

toDate32(any) → Date32

toDate32OrZero(any) → Date32

toDate32OrNull(any) → Date32

toDate32OrDefault(any [, Date32]) → Date32

toDateTime64(expr any, scale integer [, timezone text]) → DateTime64

toDateTime64OrZero(expr any, scale integer [, timezone text]) → DateTime64

toDateTime64OrNull(expr any, scale integer [, timezone text]) → DateTime64

toDateTime64OrDefault(expr any, scale integer [, timezone text] [, DateTime64]) → DateTime64

toDecimal32(value numeric or text, S numeric) → Decimal32

toDecimal64(value numeric or text, S numeric) → Decimal64

toDecimal128(value numeric or text, S numeric) → Decimal128

toDecimal256(value numeric or text, S numeric) → Decimal256

toDecimal32OrNull(expr text, S numeric) → Decimal32

toDecimal64OrNull(expr text, S numeric) → Decimal64

toDecimal128OrNull(expr text, S numeric) → Decimal128

toDecimal256OrNull(expr text, S numeric) → Decimal256

toDecimal32OrDefault(expr text, S numeric, Decimal32) → Decimal32

toDecimal64OrDefault(expr text, S numeric, Decimal64) → Decimal64

toDecimal128OrDefault(expr text, S numeric, Decimal128) → Decimal128

toDecimal256OrDefault(expr text, S numeric, Decimal256) → Decimal256

toDecimal32OrZero(expr text, S numeric) → Decimal32

toDecimal64OrZero(expr text, S numeric) → Decimal64

toDecimal128OrZero(expr text, S numeric) → Decimal128

toDecimal256OrZero(expr text, S numeric) → Decimal256

toString(any) → String

toFixedString(s String, N numeric) → FixedString

toStringCutToZero(s String or FixedString) → String

toDecimalString(number numeric, scale UInt8) → String

reinterpretAsUInt8(any) → UInt8

reinterpretAsUInt16(any) → UInt16

reinterpretAsUInt32(any) → UInt32

reinterpretAsUInt64(any) → UInt64

reinterpretAsInt8(any) → UInt8

reinterpretAsInt16(any) → UInt16

reinterpretAsInt32(any) → UInt32

reinterpretAsInt64(any) → UInt64

reinterpretAsFloat32(any) → Float32

reinterpretAsFloat64(any) → Float64

reinterpretAsDate(any) → Date

reinterpretAsDateTime(any) → DateTime

reinterpretAsString(any) → String

reinterpretAsFixedString(any) → FixedString

reinterpretAsUUID(Fixed String) → UUID

reinterpret(x any, type String) → any

cast(x any, T String) → String

CAST(x any, T String) → String

accurateCast(x any, T String) → any

accurateCastOrNull(x any, T String) → any

accurateCastOrDefault(x any, T String [, default_value any]) → any

toIntervalSecond(integer) → interval

toIntervalMinute(integer) → interval

toIntervalHour(integer) → interval

toIntervalDay(integer) → interval

toIntervalWeek(integer) → interval

toIntervalMonth(integer) → interval

toIntervalQuarter(integer) → interval

toIntervalYear(integer) → interval

parseDateTime(str text, format text [, timezone text]) → timestamp

TO_TIMESTAMP(str text, format text [, timezone text]) → timestamp

parseDateTimeOrZero(str text, format text [, timezone text]) → timestamp

parseDateTimeOrNull(str text, format text [, timezone text]) → timestamp

str_to_date(str text, format text [, timezone text]) → timestamp

parseDateTimeInJodaSyntax(str text, format text [, timezone text]) → timestamp

parseDateTimeInJodaSyntaxOrZero(str text, format text [, timezone text]) → timestamp

parseDateTimeInJodaSyntaxOrNull(str text, format text [, timezone text]) → timestamp

parseDateTimeBestEffort(time_string text [, timezone text]) → timestamp

parseDateTimeBestEffortUS(time_string text [, timezone text]) → timestamp

parseDateTimeBestEffortOrNull(time_string text [, timezone text]) → timestamp

parseDateTime32BestEffortOrNull(time_string text [, timezone text]) → timestamp

parseDateTimeBestEffortOrZero(time_string text [, timezone text]) → timestamp

parseDateTime32BestEffortOrZero(time_string text [, timezone text]) → timestamp

parseDateTimeBestEffortUSOrNull(time_string text [, timezone text]) → timestamp

parseDateTimeBestEffortUSOrZero(time_string text [, timezone text]) → timestamp

parseDateTime64BestEffort(time_string text [, precision uint8] [, timezone text]) → timestamp

parseDateTime64BestEffortUS(time_string text [, precision uint8] [, timezone text]) → timestamp

parseDateTime64BestEffortOrNull(time_string text [, precision uint8] [, timezone text]) → timestamp

parseDateTime64BestEffortOrZero(time_string text [, precision uint8] [, timezone text]) → timestamp

parseDateTime64BestEffortUSOrNull(time_string text [, precision uint8] [, timezone text]) → timestamp

parseDateTime64BestEffortUSOrZero(time_string text [, precision uint8] [, timezone text]) → timestamp

toLowCardinality(expr any) → any

toUnixTimestamp64Milli(value DateTime64) → Int64

toUnixTimestamp64Micro(value DateTime64) → Int64

toUnixTimestamp64Nano(value DateTime64) → Int64

fromUnixTimestamp64Milli(value Int64) → DateTime64

fromUnixTimestamp64Micro(value Int64) → DateTime64

fromUnixTimestamp64Nano(value Int64) → DateTime64

formatRow(format String, x any, y any [, ...]) → String

formatRowNoNewline(format String, x any, y any [, ...]) → String

snowflakeToDateTime(value Int64 [, time_zone text]) → DateTime

snowflakeToDateTime(value Int64 [, time_zone text]) → DateTime64

dateTimeToSnowflake(value DateTime) → Int64

dateTimeToSnowflake(value DateTime64) → Int64

Tuple Functions

FunctionSupported

tuple(any [, ...]) → Tuple

tupleElement(tuple Tuple, index numeric [, default_value any]) → any

tupleElement(tuple Tuple, index text [, default_value any]) → any

tupleHammingDistance(Tuple, Tuple) → numeric

tupleNames(tuple Tuple) → Array(String)

tuplePlus(Tuple, Tuple) → Tuple

tupleMinus(Tuple, Tuple) → Tuple

tupleMultiply(Tuple, Tuple) → Tuple

tupleDivide(Tuple, Tuple) → Tuple

tupleNegate(Tuple) → Tuple

tupleMultiplyByNumber(Tuple, numeric) → Tuple

tupleDivideByNumber(Tuple, numeric) → Tuple

tupleConcat(Tuple [, ...]) → Tuple

tupleIntDiv(tuple_num Tuple, tuple_div Tuple) → Tuple

tupleIntDivOrZero(tuple_num Tuple, tuple_div Tuple) → Tuple

tupleIntDivByNumber(tuple_num Tuple, div numeric) → Tuple

tupleIntDivOrZeroByNumber(tuple_num Tuple, div numeric) → Tuple

tupleModulo(tuple_num Tuple, tuple_mod Tuple) → Tuple

tupleModuloByNumber(tuple_num Tuple, div numeric) → Tuple

flattenTuple(input Tuple) → Tuple

Aggregate Functions

FunctionSupported

count(expr any) → integer

count() → integer

count(*) → integer

countIf(expr any, cond boolean) → integer

countIf(cond boolean) → integer

countIf(*, cond boolean) → integer

boundingRatio(numeric, numeric) → numeric

min(any) → any

minSimpleState(any) → any

minState(any) → any

minMerge(any) → any

max(any) → any

maxSimpleState(any) → any

maxState(any) → any

maxMerge(any) → any

sum(numeric) → numeric

sumIf(numeric, cond boolean) → numeric

sumSimpleState(numeric) → numeric

sumState(numeric) → numeric

sumMerge(numeric) → numeric

avg(x numeric) → float64

avgIf(x numeric, cond boolean) → float64

avgSimpleState(numeric) → numeric

avgState(numeric) → numeric

avgMerge(numeric) → numeric

any(any) → any

anySimpleState(any) → any

anyState(any) → any

anyMerge(any) → any

first_value(any) → any

last_value(any) → any

stddevPop(x numeric, y numeric) → float64

stddevPropStable(x numeric, y numeric) → float64

STD(x numeric, y numeric) → float64

STDDEV_POP(x numeric, y numeric) → float64

stddevSamp(expr numeric) → float64

stddevSampStable(expr numeric) → float64

varPop(x numeric, y numeric) → float64

varPopStable(x numeric, y numeric) → float64

varSamp(expr numeric) → float64

varSampStable(expr numeric) → float64

covarPop(x numeric, y numeric) → float64

covarPopStable(x numeric, y numeric) → float64

covarSamp(x numeric, y numeric) → float64

covarSampStable(x numeric, y numeric) → float64

anyHeavy(any) → any

anyLast(any) → any

argMax(arg any, val any) → any

argMin(arg any, val any) → any

avgWeighted(x numeric, weight numeric) → numeric

corr(x numeric, y numeric) → numeric

corrStable(x numeric, y numeric) → numeric

exponentialMovingAverage(x numeric, value numeric, timeunit numeric) → numeric

⌛️

topK(N integer, column any) → anyarray

topK(N integer, load_factor integer, column any) → anyarray

⌛️

topKWeighted(N integer, column any, weight numeric) → anyarray

topKWeighted(N integer, load_factor integer, column any, weight numeric) → anyarray

⌛️

array_concat_agg(x any) → anyarray

array_concat_agg(max_size integer, x any) → anyarray

⌛️

groupArray(x any) → anyarray

groupArray(max_size integer, x any) → anyarray

⌛️

groupArrayLast(max_size integer, x any) → anyarray

⌛️

groupUniqArray(x any) → anyarray

groupUniqArray(max_size integer, x any) → anyarray

⌛️

groupArrayInsertAt(default_x any, size uint32, x any, pos uint32) → anyarray

⌛️

groupArrayMovingSum(numbers_for_summing numeric) → numeric

groupArrayMovingSum(window_size numeric, numbers_for_summing numeric) → numeric

⌛️

groupArrayMovingAvg(numbers_for_summing numeric) → numeric

groupArrayMovingAvg(window_size numeric, numbers_for_summing numeric) → numeric

⌛️

groupArraySample(max_size uint64 [, seed uint64], x any) → anyarray

⌛️

groupArrayIntersect(x any) → anyarray

groupBitAnd(expr numeric) → same as input type

groupBitOr(expr numeric) → same as input type

groupBitXor(expr numeric) → same as input type

groupBitmap(expr numeric) → same as input type

groupBitmapAnd(expr numeric) → same as input type

groupBitmapXor(expr numeric) → same as input type

sumWithOverflow(expr numeric) → same as input type

deltaSum(value numeric) → same as input type

deltaSumTimestamp(value numeric, timestamp numeric or date or timestamp) → numeric

rankCorr(x numeric, y numeric) → numeric

sumKahan(numeric) → same as input type

intervalLengthSum(start numeric, end numeric) → numeric

skewPop(expr numeric) → float64

skewSamp(expr numeric) → float64

kurtPop(expr numeric) → float64

kurtSamp(expr numeric) → float64

uniq(x any [, ...]) → uint64

uniqSimpleState(x any [, ...]) → uint64

uniqState(x any [, ...]) → uint64

uniqMerge(x any [, ...]) → uint64

uniqExact(x any [, ...]) → uint64

uniqExactSimpleState(x any [, ...]) → uint64

uniqExactState(x any [, ...]) → uint64

uniqExactMerge(x any [, ...]) → uint64

uniqCombined(x any [, ...]) → uint64

uniqCombined(HLL_precision integer, expr any [, ...]) → uint64

⌛️

uniqCombinedSimpleState(x any [, ...]) → uint64

uniqCombinedState(HLL_precision integer, expr any [, ...]) → uint64

uniqCombinedMerge(HLL_precision integer, expr any [, ...]) → uint64

uniqCombined64(x any [, ...]) → uint64

uniqCombined64(HLL_precision integer, expr any [, ...]) → uint64

⌛️

uniqCombined64SimpleState(x any [, ...]) → uint64

uniqCombined64State(HLL_precision integer, expr any [, ...]) → uint64

uniqCombined64Merge(HLL_precision integer, expr any [, ...]) → uint64

uniqHLL12(x any [, ...]) → uint64

uniqHLL12SimpleState(x any [, ...]) → uint64

uniqHLL12State(x any [, ...]) → uint64

uniqHLL12Merge(x any [, ...]) → uint64

uniqTheta(x any [, ...]) → uint64

uniqThetaSimpleState(x any [, ...]) → uint64

uniqThetaState(x any [, ...]) → uint64

uniqThetaMerge(x any [, ...]) → uint64

quantile(level numeric, expr numeric or date or timestamp) → any

⌛️

quantileSimpleState(level numeric, expr numeric or date or timestamp) → any

quantileState(level numeric, expr numeric or date or timestamp) → any

quantileMerge(level numeric, expr numeric or date or timestamp) → any

UUID Functions

FunctionSupported

generateUUIDv4(x any) → uuid

empty(uuid uuid) → boolean

notEmpty(uuid uuid) → boolean

toUUID(x text) → uuid

toUUIDOrDefault(x text, default uuid) → uuid

toUUIDOrNull(x text) → uuid

toUUIDOrZero(x text) → uuid

UUIDStringToNum(text [, variant integer]) → text

UUIDNumToString(text [, variant integer]) → text

serverUUID() → text

⌛️