Relational Functions
A function is a set of predefined operations used to compute or convert data.
Special Syntax Forms
The following syntax forms are recognized for compatibility with the SQL standard and PostgreSQL, but are equivalent to regular built-in functions.
| Special Form | Equivalent to |
|---|---|
AT TIME ZONE | timezone() |
CURRENT_CATALOG | current_database() |
COLLATION FOR | pg_collation_for() |
CURRENT_DATE | current_date() |
CURRENT_ROLE | current_user() |
CURRENT_SCHEMA | current_schema() |
CURRENT_TIMESTAMP | current_timestamp() |
CURRENT_TIME | current_time() |
CURRENT_USER | current_user() |
EXTRACT(<part> FROM <value>) | extract("<part>", <value>) |
EXTRACT_DURATION(<part>FROM <value>) | extract_duration("<part>",<value>) |
OVERLAY(<text1> PLACING <text2> FROM <int1> FOR <int2>) | overlay(<text1>,<text2>, <int1>, <int2>) |
OVERLAY(<text1> PLACING <text2> FROM <int>) | overlay(<text1>,<text2>, <int>) |
POSITION(<text1> IN <text2>) | strpos(<text2>, <text1>) |
SESSION_USER | current_user() |
SUBSTRING(<text>FOR<int1>FROM <int2>) | substring(<text>,<int2>, <int1>) |
SUBSTRING(<text> FOR <int>) | substring(<text>, 1, <int>) |
SUBSTRING(<text>FROM<int1>FOR<int2>) | substring(<text>,<int1>, <int2>) |
SUBSTRING(<text> FROM <int>) | substring(<text>, <int>) |
TRIM(<text1> FROM <text2>) | btrim(<text2>, <text1>) |
TRIM(<text1>, <text2>) | btrim(<text1>, <text2>) |
TRIM(FROM <text>) | btrim(<text>) |
TRIM(LEADING <text1> FROM <text2>) | ltrim(<text2>, <text1>) |
TRIM(LEADING FROM <text>) | ltrim(<text>) |
TRIM(TRAILING <text1> FROM <text2>) | rtrim(<text2>, <text1>) |
TRIM(TRAILING FROM <text>) | rtrim(<text>) |
USER | current_user() |
Conditional and Function-like Operators
This table lists the operators that look like built-in functions but have special evaluation rules.
| Operator | Description |
|---|---|
ANNOTATE_TYPE(...) | Explicitly typed eExpression |
ARRAY(...) | Conversion of subquery results to an array |
ARRAY[...] | Conversion of scalar expressions to an array |
CAST(...) | Type cast |
COALESCE(...) | First non-NULL expression with short circuit |
EXISTS(...) | Existence test on the result of subqueries |
IF(...) | Conditional evaluation |
IFNULL(...) | Alias for COALESCE restricted to two operands Note - When both operands are explicitly declared, they must have the same type. Otherwise, the system cannot evaluate them. - When one operand is explicitly declared and the other operand is a constant, the system converts the constant to the specified data type and then evaluates them. If failed to convert, the system returns an error. - When both operands are constants, the system evaluates the operands if they have the same type (numeric or string type). If one operand is a numeric constant and the other one is a string-typed constant, the system converts the string-typed constant to the numeric-typed constant and then evaluates them. If failed to convert, the system returns an error. |
NULLIF(...) | Return NULL conditionally Note - When both operands are explicitly declared, they must have the same type. Otherwise, the system cannot evaluate them. - When one operand is explicitly declared and the other operand is a constant, the system converts the constant to the specified data type and then evaluates them. If failed to convert, the system returns an error. - When both operands are constants, the system evaluates the operands if they have the same type (numeric or string type). If one operand is a numeric constant and the other one is a string-typed constant, the system converts the string-typed constant to the numeric-typed constant and then evaluates them. If failed to convert, the system returns an error. |
ROW(...) | Tuple constructor |
Buit-in Functions
Array Functions
| Function → Returns | Description |
|---|---|
| array_append(array: bool[], elem: bool) → bool[] | Append elem to array, returning the result. |
| array_append(array: bytes[], elem: bytes) → bytes[] | Append elem to array, returning the result. |
| array_append(array: date[], elem: date) → date[] | Append elem to array, returning the result. |
| array_append(array: decimal[], elem: decimal) → decimal[] | Append elem to array, returning the result. |
| array_append(array: float4[], elem: float4) → float4[] | Append elem to array, returning the result. |
| array_append(array: float8[], elem: float8) → float8[] | Append elem to array, returning the result. |
| array_append(array: inet[], elem: inet) → inet[] | Append elem to array, returning the result. |
| array_append(array: int2[], elem: int2) → int8[] | Append elem to array, returning the result. |
| array_append(array: int2[], elem: int4) → int8[] | Append elem to array, returning the result. |
| array_append(array: int2[], elem: int8) → int8[] | Append elem to array, returning the result. |
| array_append(array: int4[], elem: int2) → int8[] | Append elem to array, returning the result. |
| array_append(array: int4[], elem: int4) → int8[] | Append elem to array, returning the result. |
| array_append(array: int4[], elem: int8) → int8[] | Append elem to array, returning the result. |
| array_append(array: int8[], elem: int2) → int8[] | Append elem to array, returning the result. |
| array_append(array: int8[], elem: int4) → int8[] | Append elem to array, returning the result. |
| array_append(array: int8[], elem: int8) → int8[] | Append elem to array, returning the result. |
| array_append(array: interval[], elem: interval) → interval[] | Append elem to array, returning the result. |
| array_append(array: string[], elem: string) → string[] | Append elem to array, returning the result. |
| array_append(array: time[], elem: time) → time[] | Append elem to array, returning the result. |
| array_append(array: timestamp[], elem: timestamp) → timestamp[] | Append elem to array, returning the result. |
| array_append(array: timestamptz[], elem: timestamptz) → timestamptz[] | Append elem to array, returning the result. |
| array_append(array: uuid[], elem: uuid) → uuid[] | Append elem to array, returning the result. |
| array_append(array: oid[], elem: oid) → oid[] | Append elem to array, returning the result. |
| array_append(array: timetz[], elem: timetz) → timetz[] | Append elem to array, returning the result. |
| array_append(array: varbit[], elem: varbit) → varbit[] | Append elem to array, returning the result. |
| array_cat(left: bool[], right: bool[]) → bool[] | Append two arrays. |
| array_cat(left: bytes[], right: bytes[]) → bytes[] | Append two arrays. |
| array_cat(left: date[], right: date[]) → date[] | Append two arrays. |
| array_cat(left: decimal[], right: decimal[]) → decimal[] | Append two arrays. |
| array_cat(left: float4[], right: float4[]) → float8[] | Append two arrays. |
| array_cat(left: float4[], right: float8[]) → float8[] | Append two arrays. |
| array_cat(left: float8[], right: float4[]) → float8[] | Append two arrays. |
| array_cat(left: float8[], right: float8[]) → float8[] | Append two arrays. |
| array_cat(left: inet[], right: inet[]) → inet[] | Append two arrays. |
| array_cat(left: int2[], right: int2[]) → int8[] | Append two arrays. |
| array_cat(left: int2[], right: int4[]) → int8[] | Append two arrays. |
| array_cat(left: int2[], right: int8[]) → int8[] | Append two arrays. |
| array_cat(left: int4[], right: int2[]) → int8[] | Append two arrays. |
| array_cat(left: int4[], right: int4[]) → int8[] | Append two arrays. |
| array_cat(left: int4[], right: int8[]) → int8[] | Append two arrays. |
| array_cat(left: int8[], right: int2[]) → int8[] | Append two arrays. |
| array_cat(left: int8[], right: int4[]) → int8[] | Append two arrays. |
| array_cat(left: int8[], right: int8[]) → int8[] | Append two arrays. |
| array_cat(left: interval[], right: interval[]) → interval[] | Append two arrays. |
| array_cat(left: string[], right: string[]) → string[] | Append two arrays. |
| array_cat(left: time[], right: time[]) → time[] | Append two arrays. |
| array_cat(left: timestamp[], right: timestamp[]) → timestamp[] | Append two arrays. |
| array_cat(left: timestamptz[], right: timestamptz[]) → timestamptz[] | Append two arrays. |
| array_cat(left: uuid[], right: uuid[]) → uuid[] | Append two arrays. |
| array_cat(left: oid[], right: oid[]) → oid[] | Append two arrays. |
| array_cat(left: timetz[], right: timetz[]) → timetz[] | Append two arrays. |
| array_cat(left: varbit[], right: varbit[]) → varbit[] | Append two arrays. |
| array_length(input:anyelement[],array_dimension: int8) → int8 | Calculate the length of input on the provided array_dimension. But, because KWDB does not yet support multi-dimensional arrays, the only supported array_dimension is 1. |
| array_lower(input:anyelement[],array_dimension: int8) → int8 | Calculate the minimum value of input on the provided array_dimension. But, because KWDB does not yet support multi-dimensional arrays, the only supported array_dimension is 1. |
| array_position(array: bool[], elem: bool) → int8 | Return the index of the first elem in array. |
| array_position(array: bytes[], elem: bytes) → int8 | Return the index of the first elem in array. |
| array_position(array: date[], elem: date) → int8 | Return the index of the first elem in array. |
| array_position(array: decimal[], elem: decimal) → int8 | Return the index of the first elem in array. |
| array_position(array: float4[], elem: float4) → int8 | Return the index of the first elem in array. |
| array_position(array: float8[], elem: float8) → int8 | Return the index of the first elem in array. |
| array_position(array: inet[], elem: inet) → int8 | Return the index of the first elem in array. |
| array_position(array: int2[], elem: int2) → int8 | Return the index of the first elem in array. |
| array_position(array: int4[], elem: int4) → int8 | Return the index of the first elem in array. |
| array_position(array: int8[], elem: int8) → int8 | Return the index of the first elem in array. |
| array_position(array: interval[], elem: interval) → int8 | Return the index of the first elem in array. |
| array_position(array: string[], elem: string) → int8 | Return the index of the first elem in array. |
| array_position(array: time[], elem: time) → int8 | Return the index of the first elem in array. |
| array_position(array:timestamp[],elem:timestamp) → int8 | Return the index of the first elem in array. |
| array_position(array:timestamptz[],elem:timestamptz) → int8 | Return the index of the first elem in array. |
| array_position(array: uuid[], elem: uuid) → int8 | Return the index of the first elem in array. |
| array_position(array: oid[], elem: oid) → int8 | Return the index of the first elem in array. |
| array_position(array: timetz[], elem: timetz) → int8 | Return the index of the first elem in array. |
| array_position(array: varbit[], elem: varbit) → int8 | Return the index of the first elem in array. |
| array_positions(array: bool[], elem: bool) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: bytes[], elem: bytes) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: date[], elem: date) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: decimal[], elem: decimal) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: float4[], elem: float4) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: float8[], elem: float8) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: inet[], elem: inet) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: int2[], elem: int2) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: int4[], elem: int4) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: int8[], elem: int8) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: interval[], elem: interval) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: string[], elem: string) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: time[], elem: time) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array:timestamp[],elem:timestamp) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array:timestamptz[],elem:timestamptz) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: uuid[], elem: uuid) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: oid[], elem: oid) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: timetz[], elem: timetz) → int8[] | Return an array of indexes of elem in array. |
| array_positions(array: varbit[], elem: varbit) → int8[] | Return an array of indexes of elem in array. |
| array_prepend(elem: bool, array: bool[]) → bool[] | Prepend elem to array, returning the result. |
| array_prepend(elem: bytes, array: bytes[]) → bytes[] | Prepend elem to array, returning the result. |
| array_prepend(elem: date, array: date[]) → date[] | Prepend elem to array, returning the result. |
| array_prepend(elem: decimal, array: decimal[]) → decimal[] | Prepend elem to array, returning the result. |
| array_prepend(elem: float4, array: float4[]) → float4[] | Prepend elem to array, returning the result. |
| array_prepend(elem: float8, array: float8[]) → float8[] | Prepend elem to array, returning the result. |
| array_prepend(elem: inet, array: inet[]) → inet[] | Prepend elem to array, returning the result. |
| array_prepend(elem: int2, array: int2[]) → int2[] | Prepend elem to array, returning the result. |
| array_prepend(elem: int4, array: int4[]) → int4[] | Prepend elem to array, returning the result. |
| array_prepend(elem: int8, array: int8[]) → int8[] | Prepend elem to array, returning the result. |
| array_prepend(elem: interval, array: interval[]) → interval[] | Prepend elem to array, returning the result. |
| array_prepend(elem: string, array: string[]) → string[] | Prepend elem to array, returning the result. |
| array_prepend(elem: time, array: time[]) → time[] | Prepend elem to array, returning the result. |
| array_prepend(elem:timestamp,array:timestamp[]) → timestamp[] | Prepend elem to array, returning the result. |
| array_prepend(elem:timestamptz,array:timestamptz[]) → timestamptz[] | Prepend elem to array, returning the result. |
| array_prepend(elem: uuid, array: uuid[]) → uuid[] | Prepend elem to array, returning the result. |
| array_prepend(elem: oid, array: oid[]) → oid[] | Prepend elem to array, returning the result. |
| array_prepend(elem: timetz, array: timetz[]) → timetz[] | Prepend elem to array, returning the result. |
| array_prepend(elem: varbit, array: varbit[]) → varbit[] | Prepend elem to array, returning the result. |
| array_remove(array: bool[], elem: bool) → bool[] | Equal to elem from array. Remove all elements. |
| array_remove(array: bytes[], elem: bytes) → bytes[] | Remove all elements equal to elem from array. |
| array_remove(array: date[], elem: date) → date[] | Remove all elements equal to elem from array. |
| array_remove(array: decimal[], elem: decimal) → decimal[] | Remove all elements equal to elem from array. |
| array_remove(array: float4[], elem: float4) → float4[] | Remove all elements equal to elem from array. |
| array_remove(array: float8[], elem: float8) → float8[] | Remove all elements equal to elem from array. |
| array_remove(array: inet[], elem: inet) → inet[] | Remove all elements equal to elem from array. |
| array_remove(array: int2[], elem: int2) → int2[] | Remove all elements equal to elem from array. |
| array_remove(array: int4[], elem: int4) → int4[] | Remove all elements equal to elem from array. |
| array_remove(array: int8[], elem: int8) → int8[] | Remove all elements equal to elem from array. |
| array_remove(array: interval[], elem: interval) → interval[] | Remove all elements equal to elem from array. |
| array_remove(array: string[], elem: string) → string[] | Remove all elements equal to elem from array. |
| array_remove(array: time[], elem: time) → time[] | Remove all elements equal to elem from array. |
| array_remove(array:timestamp[],elem:timestamp) → timestamp[] | Remove all elements equal to elem from array. |
| array_remove(array:timestamptz[],elem:timestamptz) → timestamptz[] | Remove all elements equal to elem from array. |
| array_remove(array: uuid[], elem: uuid) → uuid[] | Remove all elements equal to elem from array. |
| array_remove(array: oid[], elem: oid) → oid[] | Remove all elements equal to elem from array. |
| array_remove(array: timetz[], elem: timetz) → timetz[] | Remove all elements equal to elem from array. |
| array_remove(array: varbit[], elem: varbit) → varbit[] | Remove all elements equal to elem from array. |
| array_replace(array: bool[], toreplace: bool, replacewith: bool) → bool[] | Replace toreplace in array with replacewith. |
| array_replace(array: bytes[], toreplace: bytes, replacewith: bytes) → bytes[] | Replace toreplace in array with replacewith. |
| array_replace(array: date[], toreplace: date, replacewith: date) → date[] | Replace toreplace in array with replacewith. |
| array_replace(array: decimal[], toreplace: decimal, replacewith: decimal) → decimal[] | Replace toreplace in array with replacewith. |
| array_replace(array: float4[], toreplace: float4, replacewith: float4) → float4[] | Replace toreplace in array with replacewith. |
| array_replace(array: float8[], toreplace: float8, replacewith: float8) → float8[] | Replace toreplace in array with replacewith. |
| array_replace(array: inet[], toreplace: inet, replacewith: inet) → inet[] | Replace toreplace in array with replacewith. |
| array_replace(array: int2[], toreplace: int2, replacewith: int2) → int2[] | Replace toreplace in array with replacewith. |
| array_replace(array: int4[], toreplace: int4, replacewith: int4) → int4[] | Replace toreplace in array with replacewith. |
| array_replace(array: int8[], toreplace: int8, replacewith: int8) → int8[] | Replace toreplace in array with replacewith. |
| array_replace(array: interval[], toreplace: interval, replacewith: interval) → interval[] | Replace toreplace in array with replacewith. |
| array_replace(array: string[], toreplace: string, replacewith: string) → string[] | Replace toreplace in array with replacewith. |
| array_replace(array: time[], toreplace: time, replacewith: time) → time[] | Replace toreplace in array with replacewith. |
| array_replace(array: timestamp[], toreplace: timestamp, replacewith: timestamp) → timestamp[] | Replace toreplace in array with replacewith. |
| array_replace(array: timestamptz[], toreplace: timestamptz, replacewith: timestamptz) → timestamptz[] | Replace toreplace in array with replacewith. |
| array_replace(array: uuid[], toreplace: uuid, replacewith: uuid) → uuid[] | Replace toreplace in array with replacewith. |
| array_replace(array: oid[], toreplace: oid, replacewith: oid) → oid[] | Replace toreplace in array with replacewith. |
| array_replace(array: timetz[], toreplace: timetz, replacewith: timetz) → timetz[] | Replace toreplace in array with replacewith. |
| array_replace(array: varbit[], toreplace: varbit, replacewith: varbit) → varbit[] | Replace toreplace in array with replacewith. |
| array_to_string(input: anyelement[], delim: string) → string | Join an array into a string with a delimiter. |
| array_to_string(input: anyelement[], delimiter: string, null: string) → string | Join an array into a string with a delimiter, replacing NULLs with a null string. |
| array_upper(input: anyelement[], array_dimension: int8) → int8 | Calculate the maximum value of input on the provided array_dimension. However, because KWDB does not yet support multi-dimensional arrays, the only supported array_dimension is 1. |
| string_to_array(str: string, delimiter: string) → string[] | Split a string into components on a delimiter. |
| string_to_array(str: string, delimiter: string, null: string) → string[] | Split a string into components on a delimiter, replacing NULLs with a null string. |
BOOL Functions
| Function → Returns | Description |
|---|---|
| ilike_escape(unescaped: string, pattern: string, escape: string) → bool | Match case insensitively unescaped with pattern using escape as an escape token. |
| inet_contained_by_or_equals(val: inet, container: inet) → bool | Test for subnet inclusion or equality, using only the network parts of the addresses. The host part of the addresses is ignored. |
| inet_contains_or_equals(container: inet, val: inet) → bool | Test for subnet inclusion or equality, using only the network parts of the addresses. The host part of the addresses is ignored. |
| inet_same_family(val: inet, val: inet) → bool | Check if two IP addresses are of the same IP family. |
| like_escape(unescaped: string, pattern: string, escape: string) → bool | Match unescaped with pattern using escape as an escape token. |
| not_ilike_escape(unescaped: string, pattern: string, escape: string) → bool | Check whether unescaped not matches case insensitively with pattern using escape as an escape token. |
| not_like_escape(unescaped: string, pattern: string, escape: string) → bool | Check whether unescaped not matches with pattern using escape as an escape token. |
| not_similar_to_escape(unescaped: string, pattern: string, escape: string) → bool | Check whether unescaped not matches with pattern using escape as an escape token. |
| similar_to_escape(unescaped: string, pattern: string, escape: string) → bool | Match unescaped with pattern using escape as an escape token. |
Comparison Functions
| Function → Returns | Description |
|---|---|
| greatest(anyelement...) → anyelement | Return the element with the greatest value. |
| least(anyelement...) → anyelement | Return the element with the lowest value. |
Date and Time Functions
| Function → Returns | Description |
|---|---|
| age(end: timestamptz, begin: timestamptz) → interval | Calculate the interval between begin and end. |
| age(val: timestamptz) → interval | Calculate the interval between val and the current time. |
| current_date() → date | Return the date of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| current_timestamp() → date | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| current_timestamp() → timestamp | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| current_timestamp() → timestamptz | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| current_timestamp(precision: int8) → date | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| current_timestamp(precision: int8) → timestamp | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| current_timestamp(precision: int8) → timestamptz | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| date_trunc(element: string, input: date) → timestamptz | Truncate input to precision element. Set all fields that are less significant than element to zero (or one, for day and month). Compatible elements: millennium, century, decade, year, quarter, month, week, day, hour, minute, second, millisecond, microsecond. |
| date_trunc(element: string, input: time) → interval | Truncate input to precision element. Set all fields that are less significant than element to zero. Compatible elements: hour, minute, second, millisecond, microsecond. |
| date_trunc(element: string, input: timestamp) → timestamp | Truncate input to precision element. Set all fields that are less significant than element to zero (or one, for day and month). Compatible elements: millennium, century, decade, year, quarter, month, week, day, hour, minute, second, millisecond, microsecond. |
| date_trunc(element: string, input: timestamptz) → timestamptz | Truncate input to precision element. Set all fields that are less significant than element to zero (or one, for day and month). Compatible elements: millennium, century, decade, year, quarter, month, week, day, hour, minute, second, millisecond, microsecond. |
| experimental_strftime(input: date, extract_format: string) → string | From input, extract and format the time as identified in extract_format using standard strftime notation (though not all formatting is supported). |
| experimental_strftime(input: timestamp, extract_format: string) → string | From input, extract and format the time as identified in extract_format using standard strftime notation (though not all formatting is supported). |
| experimental_strftime(input: timestamptz, extract_format: string) → string | From input, extract and format the time as identified in extract_format using standard strftime notation (though not all formatting is supported). |
| extract(element: string, input: date) → float8 | Extract element from input. Compatible elements: millennium, century, decade, year, isoyear, quarter, month, week, dayofweek, isodow, dayofyear, julian, hour, minute, second, millisecond, microsecond, epoch. |
| extract(element: string, input: interval) → float8 | Extract element from input. Compatible elements: millennium, century, decade, year, month, day, hour, minute, second, millisecond, microsecond, epoch. |
| extract(element: string, input: time) → float8 | Extract element from input. Compatible elements: millennium, century, decade, year, month, day, hour, minute, second, millisecond, microsecond, epoch. |
| extract(element: string, input: timestamp) → float8 | Extract element from input. Compatible elements: millennium, century, decade, year, isoyear, quarter, month, week, dayofweek, isodow, dayofyear, julian, hour, minute, second, millisecond, microsecond, epoch. |
| extract(element: string, input: timestamptz) → float8 | Extract element from input. Compatible elements: millennium, century, decade, year, isoyear, quarter, month, week, dayofweek, isodow, dayofyear, julian, hour, minute, second, millisecond, microsecond, epoch, timezone, timezone_hour, timezone_minute. |
| extract(element: string, input: timetz) → float8 | Extract element from input. Compatible elements: hour, minute, second, millisecond, microsecond, epoch, timezone, timezone_hour, timezone_minute. |
| extract(element: string, input: int2) → float8 | Extract element from input. Compatible elements: hour, minute, second, millisecond, microsecond, epoch, timezone, timezone_hour, timezone_minute. |
| extract(element: string, input: int4) → float8 | Extract element from input. Compatible elements: hour, minute, second, millisecond, microsecond, epoch, timezone, timezone_hour, timezone_minute. |
| extract(element: string, input: int8) → float8 | Extract element from input. Compatible elements: hour, minute, second, millisecond, microsecond, epoch, timezone, timezone_hour, timezone_minute. |
| extract_duration(element: string, input: interval) → int8 | Extract element from input. Compatible elements: hour, minute, second, millisecond, microsecond. |
| localtimestamp() → date | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| localtimestamp() → timestamp | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| localtimestamp() → timestamptz | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| localtimestamp(precision: int8) → date | Return the time of the current transaction based on the specified precision. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. The precision specifies the count of digits to the right of the decimal point followed the second. |
| localtimestamp(precision: int8) → timestamp | Return the time of the current transaction based on the specified precision. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. The precision specifies the count of digits to the right of the decimal point followed the second. |
| localtimestamp(precision: int8) → timestamptz | Return the time of the current transaction based on the specified precision. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. The precision specifies the count of digits to the right of the decimal point followed the second. |
| now() → date | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| now() → timestamp | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| now() → timestamptz | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| statement_timestamp() → timestamp | Return the start time of the current statement. |
| statement_timestamp() → timestamptz | Return the start time of the current statement. |
| timeofday() → string | Return the current system time on one of the cluster nodes as a string. |
| timezone(time: time, timezone: string) → timetz | Treat given time without time zone as located in the specified time zone. |
| timezone(timestamp: timestamp, timezone: string) → timestamptz | Treat given timestamp without time zone as located in the specified time zone. |
| timezone(timestamptz: timestamptz, timezone: string) → timestamp | Convert given timestamp with time zone to the new time zone, with no time zone designation. |
| timezone(timetz: timetz, timezone: string) → timetz | Convert given time with time zone to the new time zone. |
| timezone(timezone: string, time: time) → timetz | Treat given time without time zone as located in the specified time zone. |
| timezone(timezone: string, timestamp: timestamp) → timestamptz | Treat given timestamp without time zone as located in the specified time zone. |
| timezone(timezone: string, timestamptz: timestamptz) → timestamp | Convert given timestamp with time zone to the new time zone, with no time zone designation. |
| timezone(timezone: string, timestamptz_string: string) → timestamp | Convert given timestamp with time zone to the new time zone, with no time zone designation. |
| timezone(timezone: string, timetz: timetz) → timetz | Convert given time with time zone to the new time zone. |
| transaction_timestamp() → date | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| transaction_timestamp() → timestamp | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
| transaction_timestamp() → timestamptz | Return the time of the current transaction. The value is based on a timestamp picked when the transaction starts and which stays constant throughout the transaction. This timestamp has no relationship with the commit order of concurrent transactions. |
ID Generation Functions
| Function → Returns | Description |
|---|---|
| experimental_uuid_v4() → bytes | Return a UUID. |
| gen_random_uuid() → uuid | Generate a random UUID and return it as a value of the UUID type. |
| unique_rowid() → int8 | Return a unique ID used by KWDB to generate unique row IDs if a primary key isn't defined for the table. The value is a combination of the insert timestamp and the ID of the node executing the statement, which guarantees this combination is globally unique. |
| uuid_v4() → bytes | Return a UUID. |
INET Functions
| Function → Returns | Description |
|---|---|
| abbrev(val: inet) → string | Convert the combined IP address and prefix length to an abbreviated display format as text. For INET types, this will omit the prefix length if it's not the default (32 for IPv4, 128 for IPv6). For example, abbrev('192.168.1.2/24') returns '192.168.1.2/24'. |
| broadcast(val: inet) → inet | Get the broadcast address for the network address represented by the value. For example, broadcast('192.168.1.2/24') returns '192.168.1.255/24'. |
| family(val: inet) → int8 | Extract the IP family of the value. 4 for IPv4, 6 for IPv6. For example, family('::1') returns 6. |
| host(val: inet) → string | Extract the address part of the combined address/prefixlen value as text. For example, host('192.168.1.2/16') returns '192.168.1.2'. |
| hostmask(val: inet) → inet | Create an IP host mask corresponding to the prefix length in the value. For example, hostmask('192.168.1.2/16') returns '0.0.255.255'. |
| masklen(val: inet) → int8 | Retrieve the prefix length stored in the value. For example, masklen('192.168.1.2/16') returns 16. |
| netmask(val: inet) → inet | Create an IP network mask corresponding to the prefix length in the value. For example, netmask('192.168.1.2/16') returns '255.255.0.0'. |
| set_masklen(val: inet, prefixlen: int8) → inet | Set the prefix length of val to prefixlen. For example, set_masklen('192.168.1.2', 16) returns '192.168.1.2/16'. |
| text(val: inet) → string | Convert the combined IP address and prefix length to a format as text. |
JSONB Functions
| Function → Returns | Description |
|---|---|
| array_to_json(array: anyelement[]) → jsonb | Return the array as JSON or JSONB. |
| array_to_json(array: anyelement[], pretty_bool: bool) → jsonb | Return the array as JSON or JSONB. |
| json_array_length(json: jsonb) → int8 | Return the number of elements in the outermost JSON or JSONB array. |
| json_build_array(anyelement...) → jsonb | Build a possibly-heterogeneously-typed JSON or JSONB array out of a variadic argument list. |
| json_build_object(anyelement...) → jsonb | Build a JSON object out of a variadic argument list. |
| json_extract_path(jsonb, string...) → jsonb | Return the JSON value pointed to by the variadic arguments. |
| json_object(keys: string[], values: string[]) → jsonb | Take keys and values pairwise from two separate arrays. In all other respects it is identical to the one-argument form. |
| json_object(texts: string[]) → jsonb | Build a JSON or JSONB object out of a text array. The array must have exactly one dimension with an even number of members, in which case they are taken as alternating key/value pairs. |
| json_remove_path(val: jsonb, path: string[]) → jsonb | Remove the specified path from the JSON object. |
| json_set(val: jsonb, path: string[], to: jsonb) → jsonb | Return the JSON value pointed to by the variadic arguments. |
| json_set(val: jsonb, path: string[], to: jsonb, create_missing: bool) → jsonb | Return the JSON value pointed to by the variadic arguments. If create_missing is set to false, new keys will not be inserted to objects and values will not be prepended or appended to arrays. |
| json_strip_nulls(from_json: jsonb) → jsonb | Return from_json with all object fields that have null values omitted. Other null values are unaffected. |
| json_typeof(val: jsonb) → string | Return the type of the outermost JSON value as a text string. |
| jsonb_array_length(json: jsonb) → int8 | Return the number of elements in the outermost JSON or JSONB array. |
| jsonb_build_array(anyelement...) → jsonb | Build a possibly-heterogeneously-typed JSON or JSONB array out of a variadic argument list. |
| jsonb_build_object(anyelement...) → jsonb | Build a JSON object out of a variadic argument list. |
| jsonb_extract_path(jsonb, string...) → jsonb | Return the JSON value pointed to by the variadic arguments. |
| jsonb_insert(target: jsonb, path: string[], new_val: jsonb) → jsonb | Return the JSON value pointed to by the variadic arguments. new_val will be inserted before the path target. |
| jsonb_insert(target: jsonb, path: string[], new_val: jsonb, insert_after: bool) → jsonb | Return the JSON value pointed to by the variadic arguments. If insert_after is set to true (default is false), new_val will be inserted after the path target. |
| jsonb_object(keys: string[], values: string[]) → jsonb | Take keys and values pairwise from two separate arrays. In all other respects it is identical to the one-argument form. |
| jsonb_object(texts: string[]) → jsonb | Build a JSON or JSONB object out of a text array. The array must have exactly one dimension with an even number of members, in which case they are taken as alternating key/value pairs. |
| jsonb_pretty(val: jsonb) → string | Return the given JSON value as a STRING indented and with newlines. |
| jsonb_set(val: jsonb, path: string[], to: jsonb) → jsonb | Return the JSON value pointed to by the variadic arguments. |
| jsonb_set(val: jsonb, path: string[], to: jsonb, create_missing: bool) → jsonb | Return the JSON value pointed to by the variadic arguments. If create_missing is set to false, new keys will not be inserted to objects and values will not be prepended or appended to arrays. |
| jsonb_strip_nulls(from_json: jsonb) → jsonb | Return from_json with all object fields that have null values omitted. Other null values are unaffected. |
| jsonb_typeof(val: jsonb) → string | Return the type of the outermost JSON value as a text string. |
| to_json(val: anyelement) → jsonb | Return the value as JSON or JSONB. |
| to_jsonb(val: anyelement) → jsonb | Return the value as JSON or JSONB. |
FLOAT and INT Functions
| Function → Returns | Description |
|---|---|
| abs(val: decimal) → decimal | Calculate the absolute value of val. |
| abs(val: float4) → float4 | Calculate the absolute value of val. |
| abs(val: float8) → float8 | Calculate the absolute value of val. |
| abs(val: int2) → int2 | Calculate the absolute value of val. |
| abs(val: int4) → int4 | Calculate the absolute value of val. |
| abs(val: int8) → int8 | Calculate the absolute value of val. |
| acos(val: float4) → float8 | Calculate the inverse cosine of val. |
| acos(val: float8) → float8 | Calculate the inverse cosine of val. |
| asin(val: float4) → float8 | Calculate the inverse sine of val. |
| asin(val: float8) → float8 | Calculate the inverse sine of val. |
| atan(val: float4) → float8 | Calculate the inverse tangent of val. |
| atan(val: float8) → float8 | Calculate the inverse tangent of val. |
| atan2(x: float4, y: float4) → float8 | Calculate the inverse tangent of x/y. |
| atan2(x: float4, y: float8) → float8 | Calculate the inverse tangent of x/y. |
| atan2(x: float8, y: float4) → float8 | Calculate the inverse tangent of x/y. |
| atan2(x: float8, y: float8) → float8 | Calculate the inverse tangent of x/y. |
| cbrt(val: decimal) → decimal | Calculate the cube root (∛) of val. |
| cbrt(val: float4) → float8 | Calculate the cube root (∛) of val. |
| cbrt(val: float8) → float8 | Calculate the cube root (∛) of val. |
| ceil(val: decimal) → decimal | Calculate the smallest integer not smaller than val. |
| ceil(val: float4) → float8 | Calculate the smallest integer not smaller than val. |
| ceil(val: float8) → float8 | Calculate the smallest integer not smaller than val. |
| ceil(val: int2) → float8 | Calculate the smallest integer not smaller than val. |
| ceil(val: int4) → float8 | Calculate the smallest integer not smaller than val. |
| ceil(val: int8) → float8 | Calculate the smallest integer not smaller than val. |
| ceiling(val: decimal) → decimal | Calculate the smallest integer not smaller than val. |
| ceiling(val: float4) → float8 | Calculate the smallest integer not smaller than val. |
| ceiling(val: float8) → float8 | Calculate the smallest integer not smaller than val. |
| ceiling(val: int2) → float8 | Calculate the smallest integer not smaller than val. |
| ceiling(val: int4) → float8 | Calculate the smallest integer not smaller than val. |
| ceiling(val: int8) → float8 | Calculate the smallest integer not smaller than val. |
| cos(val: float4) → float8 | Calculate the cosine of val. |
| cos(val: float8) → float8 | Calculate the cosine of val. |
| cot(val: float4) → float8 | Calculate the cotangent of val. |
| cot(val: float8) → float8 | Calculate the cotangent of val. |
| crc32c(bytes...) → int8 | Calculate the CRC-32 hash using the Castagnoli polynomial. |
| crc32c(string...) → int8 | Calculate the CRC-32 hash using the Castagnoli polynomial. |
| crc32ieee(bytes...) → int8 | Calculate the CRC-32 hash using the IEEE polynomial. |
| crc32ieee(string...) → int8 | Calculate the CRC-32 hash using the IEEE polynomial. |
| degrees(val: float4) → float8 | Convert val as a radian value to a degree value. |
| degrees(val: float8) → float8 | Convert val as a radian value to a degree value. |
| div(x: decimal, y: decimal) → decimal | Calculate the integer quotient of x/y. |
| div(x: float4, y: float4) → float8 | Calculate the integer quotient of x/y. |
| div(x: float4, y: float8) → float8 | Calculate the integer quotient of x/y. |
| div(x: float8, y: float4) → float8 | Calculate the integer quotient of x/y. |
| div(x: float8, y: float8) → float8 | Calculate the integer quotient of x/y. |
| div(x: int2, y: int2) → int8 | Calculate the integer quotient of x/y. |
| div(x: int2, y: int4) → int8 | Calculate the integer quotient of x/y. |
| div(x: int2, y: int8) → int8 | Calculate the integer quotient of x/y. |
| div(x: int4, y: int2) → int8 | Calculate the integer quotient of x/y. |
| div(x: int4, y: int4) → int8 | Calculate the integer quotient of x/y. |
| div(x: int4, y: int8) → int8 | Calculate the integer quotient of x/y. |
| div(x: int8, y: int2) → int8 | Calculate the integer quotient of x/y. |
| div(x: int8, y: int4) → int8 | Calculate the integer quotient of x/y. |
| div(x: int8, y: int8) → int8 | Calculate the integer quotient of x/y. |
| exp(val: decimal) → decimal | Calculate e ^ val. |
| exp(val: float4) → float8 | Calculate e ^ val. |
| exp(val: float8) → float8 | Calculate e ^ val. |
| floor(val: decimal) → decimal | Calculate the largest integer not greater than val. |
| floor(val: float4) → float8 | Calculate the largest integer not greater than val. |
| floor(val: float8) → float8 | Calculate the largest integer not greater than val. |
| floor(val: int2) → float8 | Calculate the largest integer not greater than val. |
| floor(val: int4) → float8 | Calculate the largest integer not greater than val. |
| floor(val: int8) → float8 | Calculate the largest integer not greater than val. |
| fnv32(bytes...) → int8 | Calculate the 32-bit FNV-1 hash value of a set of values. |
| fnv32(string...) → int8 | Calculate the 32-bit FNV-1 hash value of a set of values. |
| fnv32a(bytes...) → int8 | Calculate the 32-bit FNV-1a hash value of a set of values. |
| fnv32a(string...) → int8 | Calculate the 32-bit FNV-1a hash value of a set of values. |
| fnv64(bytes...) → int8 | Calculate the 64-bit FNV-1 hash value of a set of values. |
| fnv64(string...) → int8 | Calculate the 64-bit FNV-1 hash value of a set of values. |
| fnv64a(bytes...) → int8 | Calculate the 64-bit FNV-1a hash value of a set of values. |
| fnv64a(string...) → int8 | Calculate the 64-bit FNV-1a hash value of a set of values. |
| isnan(val: decimal) → bool | Return true if val is NaN. Otherwise, return false. |
| isnan(val: float4) → bool | Return true if val is NaN. Otherwise, return false. |
| isnan(val: float8) → bool | Return true if val is NaN. Otherwise, return false. |
| ln(val: decimal) → decimal | Calculate the natural log of val. |
| ln(val: float4) → float8 | Calculate the natural log of val. |
| ln(val: float8) → float8 | Calculate the natural log of val. |
| log(b: decimal, x: decimal) → decimal | Calculate the base b log of val. |
| log(b: float4, x: float4) → float8 | Calculate the base b log of val. |
| log(b: float4, x: float8) → float8 | Calculate the base b log of val. |
| log(b: float8, x: float4) → float8 | Calculate the base b log of val. |
| log(b: float8, x: float8) → float8 | Calculate the base b log of val. |
| log(val: decimal) → decimal | Calculate the base 10 log of val. |
| log(val: float4) → float8 | Calculate the base 10 log of val. |
| log(val: float8) → float8 | Calculate the base 10 log of val. |
| mod(x: decimal, y: decimal) → decimal | Calculate x%y. |
| mod(x: float4, y: float4) → float8 | Calculate x%y. |
| mod(x: float4, y: float8) → float8 | Calculate x%y. |
| mod(x: float8, y: float4) → float8 | Calculate x%y. |
| mod(x: float8, y: float8) → float8 | Calculate x%y. |
| mod(x: int2, y: int2) → int8 | Calculate x%y. |
| mod(x: int2, y: int4) → int8 | Calculate x%y. |
| mod(x: int2, y: int8) → int8 | Calculate x%y. |
| mod(x: int4, y: int2) → int8 | Calculate x%y. |
| mod(x: int4, y: int4) → int8 | Calculate x%y. |
| mod(x: int4, y: int8) → int8 | Calculate x%y. |
| mod(x: int8, y: int2) → int8 | Calculate x%y. |
| mod(x: int8, y: int4) → int8 | Calculate x%y. |
| mod(x: int8, y: int8) → int8 | Calculate x%y. |
| pi() → float8 | Return the value for pi (3.141592653589793). |
| pow(x: decimal, y: decimal) → decimal | Calculate x^y. |
| pow(x: float4, y: float4) → float8 | Calculate x^y. |
| pow(x: float4, y: float8) → float8 | Calculate x^y. |
| pow(x: float8, y: float4) → float8 | Calculate x^y. |
| pow(x: float8, y: float8) → float8 | Calculate x^y. |
| pow(x: int2, y: int2) → int8 | Calculate x^y. |
| pow(x: int2, y: int4) → int8 | Calculate x^y. |
| pow(x: int2, y: int8) → int8 | Calculate x^y. |
| pow(x: int4, y: int2) → int8 | Calculate x^y. |
| pow(x: int4, y: int4) → int8 | Calculate x^y. |
| pow(x: int4, y: int8) → int8 | Calculate x^y. |
| pow(x: int8, y: int2) → int8 | Calculate x^y. |
| pow(x: int8, y: int4) → int8 | Calculate x^y. |
| pow(x: int8, y: int8) → int8 | Calculate x^y. |
| power(x: decimal, y: decimal) → decimal | Calculate x^y. |
| power(x: float4, y: float4) → float8 | Calculate x^y. |
| power(x: float4, y: float8) → float8 | Calculate x^y. |
| power(x: float8, y: float4) → float8 | Calculate x^y. |
| power(x: float8, y: float8) → float8 | Calculate x^y. |
| power(x: int2, y: int2) → int8 | Calculate x^y. |
| power(x: int2, y: int4) → int8 | Calculate x^y. |
| power(x: int2, y: int8) → int8 | Calculate x^y. |
| power(x: int4, y: int2) → int8 | Calculate x^y. |
| power(x: int4, y: int4) → int8 | Calculate x^y. |
| power(x: int4, y: int8) → int8 | Calculate x^y. |
| power(x: int8, y: int2) → int8 | Calculate x^y. |
| power(x: int8, y: int4) → int8 | Calculate x^y. |
| power(x: int8, y: int8) → int8 | Calculate x^y. |
| radians(val: float4) → float8 | Convert val as a degree value to a radian value. |
| radians(val: float8) → float8 | Convert val as a degree value to a radian value. |
| random() → float8 | Return a random floating-point number between 0 (inclusive) and 1 (exclusive). |
| round(input: decimal, decimal_accuracy: int8) → decimal | Keep decimal_accuracy number of figures to the right of the zero position in input using half away from zero rounding. If decimal_accuracy is not in the range -2^31…(2^31-1), the results are undefined. |
| round(input: float4, decimal_accuracy: int8) → float8 | Keep decimal_accuracy number of figures to the right of the zero position in input using half away from zero rounding. |
| round(input: float8, decimal_accuracy: int8) → float8 | Keep decimal_accuracy number of figures to the right of the zero position in input using half away from zero rounding. |
| round(val: decimal) → decimal | Round val to the nearest integer, half away from zero: round(+/-2.4) = +/-2, round(+/-2.5) = +/-3. |
| round(val: float4) → float8 | Round val to the nearest integer using half to even (banker's) rounding. |
| round(val: float8) → float8 | Round val to the nearest integer using half to even (banker's) rounding. |
| sign(val: decimal) → decimal | Determine the sign of val. - 1: positive - 0: 0 - -1: negative |
| sign(val: float4) → float8 | Determine the sign of val. - 1: positive - 0: 0 - -1: negative |
| sign(val: float8) → float8 | Determine the sign of val. - 1: positive - 0: 0 - -1: negative |
| sign(val: int2) → int8 | Determine the sign of val. - 1: positive - 0: 0 - -1: negative |
| sign(val: int4) → int8 | Determine the sign of val. - 1: positive - 0: 0 - -1: negative |
| sign(val: int8) → int8 | Determine the sign of val. - 1: positive - 0: 0 - -1: negative |
| sin(val: float4) → float8 | Calculate the sine of val. |
| sin(val: float8) → float8 | Calculate the sine of val. |
| sqrt(val: decimal) → decimal | Calculate the square root of val. |
| sqrt(val: float4) → float8 | Calculate the square root of val. |
| sqrt(val: float8) → float8 | Calculate the square root of val. |
| tan(val: float4) → float8 | Calculate the tangent of val. |
| tan(val: float8) → float8 | Calculate the tangent of val. |
| trunc(val: decimal) → decimal | Truncate the decimal values of val. |
| trunc(val: float4) → float8 | Truncate the decimal values of val. |
| trunc(val: float8) → float8 | Truncate the decimal values of val. |
| width_bucket(operand: decimal, b1: decimal, b2: decimal, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: int8, b1: int2, b2: int2, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: int8, b1: int2, b2: int4, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: int8, b1: int2, b2: int8, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: int8, b1: int4, b2: int2, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: int8, b1: int4, b2: int4, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: int8, b1: int4, b2: int8, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: int8, b1: int8, b2: int2, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: int8, b1: int8, b2: int4, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: int8, b1: int8, b2: int8, count: int8) → int8 | Return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range B1 to B2. |
| width_bucket(operand: anyelement, thresholds: anyelement[]) → int8 | Return the bucket number to which operand would be assigned given an array listing the lower bounds of the buckets. Return 0 for an input less than the first lower bound. The thresholds array must be sorted, smallest first, or unexpected results will be obtained. |
Sequence Functions
| Function → Returns | Description |
|---|---|
| currval(sequence_name: string) → int8 | Return the latest value obtained with nextval for this sequence in this session. |
| lastval() → int8 | Return value most recently obtained with nextval in this session. |
| nextval(sequence_name: string) → int8 | Advance the given sequence and return its new value. |
| setval(sequence_name: string, value: int8) → int8 | Set the given sequence’s current value. The next call to nextval will return value + Increment. |
| setval(sequence_name: string, value: int8, is_called: bool) → int8 | Set the given sequence’s current value. If is_called is set to false, the next call to nextval will return value. Otherwise, return value + Increment. |
Set-Returning Functions
| Function → Returns | Description |
|---|---|
| aclexplode(aclitems: string[]) → tuple{oid AS grantor, oid AS grantee, string AS privilege_type, bool AS is_grantable} | Generate a virtual table containing aclitem stuff. |
| kwdb_internal.testing_callback(name: string) → int8 | Callback the callback function identified by name. It is only for internal test. |
| kwdb_internal.unary_table() → tuple | Generate a virtual table containing no values. It is only for internal test. |
| generate_series(start: int8, end: int8) → int8 | Generate a virtual table containing the integer values from start to end. |
| generate_series(start: int8, end: int8, step: int8) → int8 | Generate a virtual table containing the integer values from start to end, by increment of step. |
| generate_series(start: timestamp, end: timestamp, step: interval) → timestamp | Generate a virtual table containing the timestamp values from start to end, by increment of step. |
| generate_subscripts(array: anyelement[]) → int8 | Return a series comprising the given array’s subscripts. |
| generate_subscripts(array: anyelement[], dim: int8) → int8 | Return a series comprising the given array’s subscripts. |
| generate_subscripts(array: anyelement[], dim: int8, reverse: bool) → int8 | Return a series comprising the given array’s subscripts. When reverse is set to true, the series is returned in reverse order. |
| information_schema._pg_expandarray(input: anyelement[]) → anyelement | Return the input array as a set of rows with an index. |
| json_array_elements(input: jsonb) → jsonb | Expand a JSON array to a set of JSON values. |
| json_array_elements_text(input: jsonb) → string | Expand a JSON array to a set of text values. |
| json_each(input: jsonb) → tuple{string AS key, jsonb AS value} | Expand the outermost JSON or JSONB object into a set of key/value pairs. |
| json_each_text(input: jsonb) → tuple{string AS key, string AS value} | Expand the outermost JSON or JSONB object into a set of key/value pairs. The returned values will be of the text type. |
| json_object_keys(input: jsonb) → string | Return sorted set of keys in the outermost JSON object. |
| jsonb_array_elements(input: jsonb) → jsonb | Expand a JSON array to a set of JSON values. |
| jsonb_array_elements_text(input: jsonb) → string | Expand a JSON array to a set of text values. |
| jsonb_each(input: jsonb) → tuple{string AS key, jsonb AS value} | Expand the outermost JSON or JSONB object into a set of key/value pairs. |
| jsonb_each_text(input: jsonb) → tuple{string AS key, string AS value} | Expand the outermost JSON or JSONB object into a set of key/value pairs. The returned values will be of the text type. |
| jsonb_object_keys(input: jsonb) → string | Return sorted set of keys in the outermost JSON object. |
| pg_get_keywords() → tuple{string AS word, string AS catcode, string AS catdesc} | Generate a virtual table containing the keywords known to the SQL parser. |
| unnest(anyelement[], anyelement[], anyelement[]...) → tuple{anyelement AS unnest, anyelement AS unnest, anyelement AS unnest} | Return the input array as a set of rows. |
| unnest(input: anyelement[]) → anyelement | Return the input array as a set of rows. |
String and Byte Functions
| Function → Returns | Description |
|---|---|
| ascii(val: string) → int8 | Return the character code of the first character in val. Despite the name, the function supports Unicode too. |
| bit_length(val: bytes) → int8 | Calculate the number of bits used to represent val. |
| bit_length(val: string) → int8 | Calculate the number of bits used to represent val. |
| bit_length(val: varbit) → int8 | Calculate the number of bits used to represent val. |
| btrim(input: string, trim_chars: string) → string | Remove any characters included in trim_chars from the beginning or end of input (applies recursively). For example, btrim('doggie', 'eod') returns ggi. |
| btrim(val: string) → string | Remove all spaces from the beginning and end of val. |
| char_length(val: bytes) → int8 | Calculate the number of bytes in val. |
| char_length(val: string) → int8 | Calculate the number of characters in val. |
| character_length(val: bytes) → int8 | Calculate the number of bytes in val. |
| character_length(val: string) → int8 | Calculate the number of characters in val. |
| chr(val: int2) → string | Return the character with the code given in val. Inverse function of ascii(). |
| chr(val: int4) → string | Return the character with the code given in val. Inverse function of ascii(). |
| chr(val: int8) → string | Return the character with the code given in val. Inverse function of ascii(). |
| concat(string...) → string | Concatenate a comma-separated list of strings. |
| concat_ws(string...) → string | Use the first argument as a separator between the concatenation of the subsequent arguments. For example, concat_ws('!','wow','great') returns wow!great. |
| convert_from(str: bytes, enc: string) → string | Decode the bytes in str into a string using encoding enc. Support UTF8 and LATIN1 encodings. |
| convert_to(str: string, enc: string) → bytes | Encode the string in str as a byte array using encoding enc. Support UTF8 and LATIN1 encodings. |
| decode(text: string, format: string) → bytes | Decode data using format (hex or escape). |
| encode(data: bytes, format: string) → string | Encode data using format (hex or escape). |
| from_ip(val: bytes) → string | Convert the byte string representation of an IP address to its character string representation. |
| from_uuid(val: bytes) → string | Convert the byte string representation of a UUID to its character string representation. |
| get_bit(bit_string: varbit, index: int8) → int8 | Extract a bit at given index in the bit array. |
| get_bit(byte_string: bytes, index: int8) → int8 | Extract a bit at given index in the byte array. |
| initcap(val: string) → string | Capitalize the first letter of val. |
| left(input: bytes, return_set: int8) → bytes | Return the first return_set bytes from input. |
| left(input: string, return_set: int8) → string | Return the first return_set characters from input. |
| length(val: bytes) → int8 | Calculate the number of bytes in val. |
| length(val: string) → int8 | Calculate the number of characters in val. |
| length(val: varbit) → int8 | Calculate the number of characters in val. |
| lower(val: string) → string | Convert all characters in val to their lower-case equivalents. |
| lpad(string: string, length: int8) → string | Pad string to by adding the double quotation mark ("") to the left of string. If string is longer than length, it is truncated. |
| lpad(string: string, length: int8, fill: string) → string | Pad string to by adding fill to the left of string. If string is longer than length, it is truncated. |
| ltrim(input: string, trim_chars: string) → string | Remove any characters included in trim_chars from the beginning (left-hand side) of input (applies recursively). For example, ltrim('doggie', 'od') returns ggie. |
| ltrim(val: string) → string | Remove all spaces from the beginning (left-hand side) of val. |
| md5(bytes...) → string | Calculate the MD5 hash value of a set of values. |
| md5(string...) → string | Calculate the MD5 hash value of a set of values. |
| octet_length(val: bytes) → int8 | Calculate the number of bytes in val. |
| octet_length(val: string) → int8 | Calculate the number of bytes used to represent val. |
| octet_length(val: varbit) → int8 | Calculate the number of bits used to represent val. |
| overlay(input:string,overlay_val: string, start_pos: int8) → string | Replace characters in input with overlay_val starting at start_pos (begins at 1). For example, overlay('doggie', 'CAT', 2) returns dCATie. |
| overlay(input:string,overlay_val: string, start_pos: int8, end_pos: int8) → string | Delete the characters in input between start_pos and end_pos (count starts at 1), and then insert overlay_val at start_pos. |
| pg_collation_for(str: anyelement) → string | Return the collation of the argument. |
| quote_ident(val: string) → string | Return val suitably quoted to serve as identifier in a SQL statement. |
| quote_literal(val: string) → string | Return val suitably quoted to serve as string literal in a SQL statement. |
| quote_literal(val: anyelement) → string | Coerce val to a string and then quote it as a literal. |
| quote_nullable(val: string) → string | Coerce val to a string and then quote it as a literal. If val is NULL, return NULL. |
| quote_nullable(val: anyelement) → string | Coerce val to a string and then quote it as a literal. If val is NULL, return NULL. |
| regexp_extract(input: string, regex: string) → string | Return the first match for the Regular Expression regex in input. |
| regexp_replace(input: string, regex: string, replace: string) → string | Replace matches for the Regular Expression regex in input with the Regular Expression replace. |
| regexp_replace(input:string, regex: string, replace: string, flags: string) → string | Replace matches for the Regular Expression regex in input with the Regular Expression replace using flags. KWDB supports the following flags: - -c: Case-sensitive matching - -g: Global matching (match each substring instead of only the first) - -i: Case-insensitive matching - -m/n: Newline-sensitive (. and ... match newlines: no; \^ and $ match line boundaries: yes)- -p: Partial newline-sensitive matching (. and ... match newlines: no; \^ and $ match line boundaries: yes) - -s: Newline-insensitive (default) (. and ... match newlines: no; \^ and $ match line boundaries: yes) - -w: Inverse partial newline-sensitive matching (. and ... match newlines: no; \^ and $ match line boundaries: yes) |
| repeat(input: string, repeat_counter: int8) → string | Concatenate input repeat_counter number of times. For example, repeat('dog', 2) returns dogdog. |
| replace(input: string, find: string, replace: string) → string | Replace find with replace in input. |
| reverse(val: string) → string | Reverse the order of the string’s characters. |
| right(input: bytes, return_set: int8) → bytes | Return the last return_set bytes from input. |
| right(input: string, return_set: int8) → string | Return the last return_set character from input. |
| rpad(string: string, length: int8) → string | Pad string to by adding the double quotation mark ("") to the right of string. If string is longer than length, it is truncated. |
| rpad(string: string, length: int8, fill: string) → string | Pad string to by adding fill to the right of string. If string is longer than length, it is truncated. |
| rtrim(input: string, trim_chars: string) → string | Remove any characters included in trim_chars from the end (right-hand side) of input (applies recursively). For example, ltrim('doggie', 'od') returns ggie. |
| rtrim(val: string) → string | Remove all spaces from the end (right-hand side) of val. |
| set_bit(bit_string: varbit, index: int8, to_set: int8) → varbit | Set a bit at given index in the bit array. |
| set_bit(byte_string: bytes, index: int8, to_set: int8) → bytes | Set a bit at given index in the byte array. |
| sha1(bytes...) → string | Calculate the SHA1 hash value of a set of values. |
| sha1(string...) → string | Calculate the SHA1 hash value of a set of values. |
| sha256(bytes...) → string | Calculate the SHA256 hash value of a set of values. |
| sha256(string...) → string | Calculate the SHA256 hash value of a set of values. |
| sha512(bytes...) → string | Calculate the SHA512 hash value of a set of values. |
| sha512(string...) → string | Calculate the SHA512 hash value of a set of values. |
| split_part(input: string, delimiter: string, return_index_pos: int8) → string | Split input on delimiter and return the value in the return_index_pos position (starting at 1). For example, split_part('123.456.789.0','.',3) returns 789. |
| strpos(input: string, find: string) → int8 | Calculate the position where the string find begins in input. For example, strpos('doggie', 'gie') returns 4. |
| substr(input: string, regex: string) → string | Return a substring of input that matches the Regular Expression regex. |
| substr(input: string, regex: string, escape_char: string) → string | Return a substring of input that matches the Regular Expression regex using escape_char as your escape character instead of </code>. |
| substr(input: string, start_pos: int8) → string | Return a substring of input between sstart_pos and end_pos (count starts at 1). |
| substr(input: string, start_pos: int8, length: int8) → string | Return a substring of input starting at substart_pos (count starts at 1). |
| substring(input: string, regex: string) → string | Return a substring of input that matches the Regular Expression regex. |
| substring(input: string, regex: string, escape_char: string) → string | Return a substring of input that matches the Regular Expression regex using escape_char as your escape character instead of </code>. |
| substring(input: string, start_pos: int8) → string | Return a substring of input between sstart_pos and end_pos (count starts at 1). |
| substring(input: string, start_pos: int8, length: int8) → string | Return a substring of input starting at substart_pos (count starts at 1). |
| to_english(val: int8) → string | Represent the value of its argument using English cardinals. |
| to_hex(val: bytes) → string | Convert val to its hexadecimal representation. |
| to_hex(val: int8) → string | Convert val to its hexadecimal representation. |
| to_hex(val: string) → string | Convert val to its hexadecimal representation. |
| to_ip(val: string) → bytes | Convert the character string representation of an IP address to its byte string representation. |
| to_uuid(val: string) → bytes | Convert the character string representation of a UUID to its byte string representation. |
| translate(input: string, find: string, replace: string) → string | In input, replace the first character from find with the first character in replace. Repeat the operation for each character in find. For example, translate('doggie', 'dog', '123'); returns 1233ie. |
| upper(val: string) → string | Convert all characters in val to their upper-case equivalents. |
System Information Functions
| Function → Returns | Description |
|---|---|
| kwdb_internal.encode_key(table_id: int8, index_id: int8, row_tuple: tuple) → bytes | Generate a key for a row of a specific table and index. |
| kwdb_internal.force_assertion_error(msg: string) → int8 | It is only for internal test. |
| kwdb_internal.force_error(errorCode: string, msg: string) → int8 | It is only for internal test. |
| kwdb_internal.force_log_fatal(msg: string) → int8 | It is only for internal test. |
| kwdb_internal.force_panic(msg: string) → int8 | It is only for internal test. |
| kwdb_internal.force_retry(val: interval) → int8 | It is only for internal test. |
| kwdb_internal.get_namespace_id(parent_id: int8, name: string) → int8 | Get the namespace ID. |
| kwdb_internal.get_zone_config(namespace_id: int8) → bytes | Get the zone configurations. |
| kwdb_internal.is_admin() → bool | Get the Admin status of the current user. |
| kwdb_internal.lease_holder(key: bytes) → int8 | Get the lease holder that matches the request key. |
| kwdb_internal.locality_value(key: string) → string | Return the value for a key used for specifying a position. |
| kwdb_internal.no_constant_folding(input: anyelement) → anyelement | It is only for internal test. |
| kwdb_internal.node_executable_version() → string | Return the version of the running KWDB node. |
| kwdb_internal.notice(msg: string) → int8 | It is only for internal test. |
| kwdb_internal.num_inverted_index_entries(val: anyelement[]) → int8 | It is only for internal test. |
| kwdb_internal.num_inverted_index_entries(val: jsonb) → int8 | It is only for internal test. |
| kwdb_internal.pretty_key(raw_key: bytes, skip_fields: int8) → string | It is only for internal test. |
| kwdb_internal.range_stats(key: bytes) → jsonb | Retrieve range statistics as the JSON objects . |
| kwdb_internal.round_decimal_values(val: decimal, scale: int8) → decimal | (Internal use) Round the value of a decimal value during a mutation. |
| kwdb_internal.round_decimal_values(val: decimal[], scale: int8) → decimal[] | (Internal use) Round the value of a hexadecimal value during a mutation. |
| kwdb_internal.set_vmodule(vmodule_string: string) → int8 | Set the equivalent of the --vmodule flag at the gateway node which processes the request. It can control the level of logging details for different files. Syntax example: kwdb_internal.set_vmodule('recordio = 2,file = 1,gfs * = 3'). Reset to kwdb_internal.set_vmodule(''). Improving the level of logging details may cause significant performance degradation. |
| current_database() → string | Return the current database. |
| current_schema() → string | Return the current schema. |
| current_schemas(include_pg_catalog: bool) → string[] | Return the valid schemas in the search path. |
| current_user() → string | Return the current user. This function is compatible with PostgreSQL. |
| version() → string | Return the version of the KWDB node. |
| row_count() | Return the number of the rows modified by the DML statement. Support the INSERT, UPDATE, and DELETE statements without the RETURNING clause. Note - Except for the INSERT, UPDATE, and DELETE statements, other DML statements have no effection on this function. When this function follows other DML statements, the system returns 0 if no related DML statement was executed before. Otherwise, the system returns the number of rows affected by the last DML statement. - This function is non-transactional. |
Time Functions
| Function → Returns | Description |
|---|---|
| current_time() → time | Return the current transaction’s time with no time zone. |
| current_time() → timetz | Return the current transaction’s time with time zone. |
| current_time(precision: INT8) → time | Return the current transaction’s time with no time zone. |
| current_time(precision: INT8) → timetz | Return the current transaction’s time with time zone. |
| localtime() → time | Return the current transaction’s time with no time zone. |
| localtime() → timetz | Return the current transaction’s time with time zone. |
| localtime(precision: INT8) → time | Return the current transaction’s time with no time zone. |
| localtime(precision: INT8) → timetz | Return the current transaction’s time with time zone. |
Tuple Functions
| Function → Returns | Description |
|---|---|
| row_to_JSON(row: tuple) → jsonb | Return the row as a JSON object. |
Compatibility Functions
| Function → Returns | Description |
|---|---|
| format_type(type_oid: oid, typemod: INT8) → STRING | Return the SQL name of a data type that is identified by its type OID and possibly a type modifier. Currently, the type modifier is ignored. |
| getdatabaseencoding() → STRING | Return the current encoding name used by the database. |
| has_any_column_privilege(table:STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for any column of the table. |
| has_any_column_privilege(table: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for any column of the table. |
| has_any_column_privilege(user: STRING, table: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for any column of the table. |
| has_any_column_privilege(user: STRING, table: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for any column of the table. |
| has_any_column_privilege(user: oid, table: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for any column of the table. |
| has_any_column_privilege(user: oid, table: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for any column of the table. |
| has_column_privilege(table: STRING, column: INT8, privilege: STRING) → BOOL | Return whether or not the current user has privileges for a column. |
| has_column_privilege(table: STRING, column: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for a column. |
| has_column_privilege(table: oid, column: INT8, privilege: STRING) → BOOL | Return whether or not the current user has privileges for a column. |
| has_column_privilege(table: oid, column: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for a column. |
| has_column_privilege(user: STRING, table: STRING, column: INT8, privilege: STRING) → BOOL | Return whether or not the user has privileges for a column. |
| has_column_privilege(user: STRING, table: STRING, column: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for a column. |
| has_column_privilege(user: STRING, table: oid, column: INT8, privilege: STRING) → BOOL | Return whether or not the user has privileges for a column. |
| has_column_privilege(user: STRING, table: oid, column: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for a column. |
| has_column_privilege(user: oid, table: STRING, column: INT8, privilege: STRING) → BOOL | Return whether or not the user has privileges for a column. |
| has_column_privilege(user: oid, table: STRING, column: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for a column. |
| has_column_privilege(user: oid, table: oid, column: INT8, privilege: STRING) → BOOL | Return whether or not the user has privileges for a column. |
| has_column_privilege(user: oid,table:oid, column: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for a column. |
| has_database_privilege(database:STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the database. |
| has_database_privilege(database: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the database. |
| has_database_privilege(user: STRING, database: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the database. |
| has_database_privilege(user: STRING, database: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the database. |
| has_database_privilege(user: oid, database: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the database. |
| has_database_privilege(user: oid, database: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the database. |
| has_foreign_data_wrapper_privilege(fdw: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the foreign-data wrapper. |
| has_foreign_data_wrapper_privilege(fdw: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the foreign-data wrapper. |
| has_foreign_data_wrapper_privilege(user: STRING, fdw: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the foreign-data wrapper. |
| has_foreign_data_wrapper_privilege(user: STRING, fdw: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the foreign-data wrapper. |
| has_foreign_data_wrapper_privilege(user: oid, fdw: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the foreign-data wrapper. |
| has_foreign_data_wrapper_privilege(user: oid, fdw: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the foreign-data wrapper. |
| has_function_privilege(function: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the function. |
| has_function_privilege(function: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the function. |
| has_function_privilege(user: STRING, function: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the function. |
| has_function_privilege(user: STRING, function: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the function. |
| has_function_privilege(user: oid, function: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the function. |
| has_function_privilege(user: oid, function: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the function. |
| has_language_privilege(language: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the language. |
| has_language_privilege(language: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the language. |
| has_language_privilege(user: STRING, language: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the language. |
| has_language_privilege(user: STRING, language: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the language. |
| has_language_privilege(user: oid, language: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the language. |
| has_language_privilege(user: oid, language: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the language. |
| has_schema_privilege(schema: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the schema. |
| has_schema_privilege(schema: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the schema. |
| has_schema_privilege(user: STRING, schema: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the schema. |
| has_schema_privilege(user: STRING, schema: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the schema. |
| has_schema_privilege(user: oid, schema: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the schema. |
| has_schema_privilege(user: oid, schema: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the schema. |
| has_sequence_privilege(sequence: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the sequence. |
| has_sequence_privilege(sequence: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the sequence. |
| has_sequence_privilege(user: STRING, sequence: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the sequence. |
| has_sequence_privilege(user: STRING, sequence: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the sequence. |
| has_sequence_privilege(user: oid, sequence: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the sequence. |
| has_sequence_privilege(user: oid, sequence: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the sequence. |
| has_server_privilege(server: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the foreign server. |
| has_server_privilege(server: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the foreign server. |
| has_server_privilege(user: STRING, server: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the foreign server. |
| has_server_privilege(user: STRING, server: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the foreign server. |
| has_server_privilege(user: oid, server: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the foreign server. |
| has_server_privilege(user: oid, server: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the foreign server. |
| has_table_privilege(table: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the table. |
| has_table_privilege(table: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the table. |
| has_table_privilege(user:STRING,table:STRING,privilege: STRING) → BOOL | Return whether or not the user has privileges for the table. |
| has_table_privilege(user: STRING, table: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the table. |
| has_table_privilege(user: oid, table: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the table. |
| has_table_privilege(user: oid, table: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the table. |
| has_tablespace_privilege(tablespace:STRING,privilege: STRING) → BOOL | Return whether or not the current user has privileges for the tablespace. |
| has_tablespace_privilege(tablespace: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the tablespace. |
| has_tablespace_privilege(user: STRING, tablespace: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the tablespace. |
| has_tablespace_privilege(user: STRING, tablespace: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the tablespace. |
| has_tablespace_privilege(user: oid, tablespace: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the tablespace. |
| has_tablespace_privilege(user: oid, tablespace: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the tablespace. |
| has_type_privilege(type: STRING, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the type. |
| has_type_privilege(type: oid, privilege: STRING) → BOOL | Return whether or not the current user has privileges for the type. |
| has_type_privilege(user:STRING,type: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the type. |
| has_type_privilege(user: STRING, type: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the type. |
| has_type_privilege(user: oid, type: STRING, privilege: STRING) → BOOL | Return whether or not the user has privileges for the type. |
| has_type_privilege(user: oid, type: oid, privilege: STRING) → BOOL | Return whether or not the user has privileges for the type. |
| oid(arg1: INT2) → oid | Convert an integer to an OID. |
| oid(arg1: INT4) → oid | Convert an integer to an OID. |
| oid(arg1: INT8) → oid | Convert an integer to an OID. |
| pg_sleep(seconds: FLOAT4) → BOOL | Make the current session's process sleep until specified seconds have elapsed. seconds is a value of double precision, so fractional-second delays can be specified. |
| pg_sleep(seconds: FLOAT8) → BOOL | Make the current session's process sleep until specified seconds have elapsed. seconds is a value of double precision, so fractional-second delays can be specified. |
Aggregate Functions
Note
- Avoid the calculation results of the
AVGandSUMfunctions exceeding the maximum range supported by the function. - When aggregate queries work with
GROUP BY, avoid excessive rows in the result set for theGROUP BYclause.
| Function → Returns | Description |
|---|---|
| array_agg(arg1: BOOL) → BOOL[] | Aggregate the selected values into an array. |
| array_agg(arg1: bytes) → bytes[] | Aggregate the selected values into an array. |
| array_agg(arg1: date) → date[] | Aggregate the selected values into an array. |
| array_agg(arg1: decimal) →decimal[] | Aggregate the selected values into an array. |
| array_agg(arg1: FLOAT4) → FLOAT4[] | Aggregate the selected values into an array. |
| array_agg(arg1: FLOAT8) → FLOAT8[] | Aggregate the selected values into an array. |
| array_agg(arg1: INET) → INET[] | Aggregate the selected values into an array. |
| array_agg(arg1: INT2) → INT2[] | Aggregate the selected values into an array. |
| array_agg(arg1: INT4) → INT4[] | Aggregate the selected values into an array. |
| array_agg(arg1: INT8) → INT8[] | Aggregate the selected values into an array. |
| array_agg(arg1: interval) → interval[] | Aggregate the selected values into an array. |
| array_agg(arg1: STRING) → STRING[] | Aggregate the selected values into an array. |
| array_agg(arg1: time) → time[] | Aggregate the selected values into an array. |
| array_agg(arg1: timestamp) → timestamp[] | Aggregate the selected values into an array. |
| array_agg(arg1: timestamptz) → timestamptz[] | Aggregate the selected values into an array. |
| array_agg(arg1: UUID) → UUID[] | Aggregate the selected values into an array. |
| array_agg(arg1: oid) → oid[] | Aggregate the selected values into an array. |
| array_agg(arg1: timetz) → timetz[] | Aggregate the selected values into an array. |
| array_agg(arg1: varbit) → varbit[] | Aggregate the selected values into an array. |
| avg(arg1: decimal) → decimal | Calculate the average of the selected values. |
| avg(arg1: float4) → float8 | Calculate the average of the selected values. |
| avg(arg1: float8) → float8 | Calculate the average of the selected values. |
| avg(arg1: INT2) → DECIMAL | Calculate the average of the selected values. |
| avg(arg1: INT4) → DECIMAL | Calculate the average of the selected values. |
| avg(arg1: INT8) → DECIMAL | Calculate the average of the selected values. |
| avg(arg1: interval) → interval | Calculate the average of the selected values. |
| bit_and(arg1: int2) → int8 | Calculate the bitwise AND of all non-null input values. If none, it will be null. |
| bit_and(arg1: int4) → int8 | Calculate the bitwise AND of all non-null input values. If none, it will be null. |
| bit_and(arg1: int8) → int8 | Calculate the bitwise AND of all non-null input values. If none, it will be null. |
| bit_or(arg1: int2) → int8 | Calculate the bitwise OR of all non-null input values. If none, it will be null. |
| bit_or(arg1: int4) → int8 | Calculate the bitwise OR of all non-null input values. If none, it will be null. |
| bit_or(arg1: int8) → int8 | Calculate the bitwise OR of all non-null input values. If none, it will be null. |
| BOOL_and(arg1: BOOL) → BOOL | Calculate the boolean value of the AND operations of all selected values. |
| BOOL_or(arg1: BOOL) → BOOL | Calculate the boolean value of the OR operations of all selected values. |
| concat_agg(arg1: bytes) → bytes | Concatenate all selected values. |
| concat_agg(arg1: STRING) → STRING | Concatenate all selected values. |
| corr(arg1: FLOAT4, arg2: FLOAT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: FLOAT4, arg2: FLOAT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: FLOAT8, arg2: FLOAT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: FLOAT8, arg2: FLOAT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: FLOAT4, arg2: INT2) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: FLOAT4, arg2: INT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: FLOAT4, arg2: INT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: FLOAT8, arg2: INT2) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: FLOAT8, arg2: INT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: FLOAT8, arg2: INT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT2, arg2: FLOAT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT2, arg2: FLOAT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT4, arg2: FLOAT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT4, arg2: FLOAT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT8, arg2: FLOAT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT8, arg2: FLOAT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT2, arg2: INT2) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT2, arg2: INT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT2, arg2: INT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT4, arg2: INT2) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT4, arg2: INT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT4, arg2: INT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT8, arg2: INT2) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT8, arg2: INT4) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| corr(arg1: INT8, arg2: INT8) → FLOAT8 | Calculate the correlation coefficient of the selected values. |
| count(arg1: anyelement) → INT8 | Calculate the number of selected elements. |
| count_rows() → INT8 | Calculates the number of rows. |
| every(arg1: BOOL) → BOOL | Calculate the boolean value of the OR operations of all selected values. |
| JSON_agg(arg1: anyelement) → jsonb | Aggregate values as a JSON or JSONB array. |
| jsonb_agg(arg1: anyelement) → jsonb | Aggregate values as a JSON or JSONB array. |
| MAX(arg1: BOOL) → BOOL | Identify the maximum selected value. |
| MAX(arg1: bytes) → bytes | Identify the maximum selected value. |
| MAX(arg1: date) → date | Identify the maximum selected value. |
| MAX(arg1: decimal) → decimal | Identify the maximum selected value. |
| MAX(arg1: FLOAT4) → FLOAT4 | Identify the maximum selected value. |
| MAX(arg1: FLOAT8) → FLOAT8 | Identify the maximum selected value. |
| MAX(arg1: INET) → INET | Identify the maximum selected value. |
| MAX(arg1: INT2) → INT2 | Identify the maximum selected value. |
| MAX(arg1: INT4) → INT4 | Identify the maximum selected value. |
| MAX(arg1: INT8) → INT8 | Identify the maximum selected value. |
| MAX(arg1: interval) → interval | Identify the maximum selected value. |
| MAX(arg1: STRING) → STRING | Identify the maximum selected value. |
| MAX(arg1: time) → time | Identify the maximum selected value. |
| MAX(arg1: timestamp) → timestamp | Identify the maximum selected value. |
| MAX(arg1: timestamptz) → timestamptz | Identify the maximum selected value. |
| MAX(arg1: UUID) → UUID | Identify the maximum selected value. |
| MAX(arg1: jsonb) → jsonb | Identify the maximum selected value. |
| MAX(arg1: oid) → oid | Identify the maximum selected value. |
| MAX(arg1: timetz) → timetz | Identify the maximum selected value. |
| MAX(arg1: varbit) → varbit | Identify the maximum selected value. |
| min(arg1: BOOL) → BOOL | Identify the minimum selected value. |
| min(arg1: bytes) → bytes | Identify the minimum selected value. |
| min(arg1: date) → date | Identify the minimum selected value. |
| min(arg1: decimal) → decimal | Identify the minimum selected value. |
| min(arg1: FLOAT4) → FLOAT4 | Identify the minimum selected value. |
| min(arg1: FLOAT8) → FLOAT8 | Identify the minimum selected value. |
| min(arg1: INET) → INET | Identify the minimum selected value. |
| min(arg1: INT2) → INT2 | Identify the minimum selected value. |
| min(arg1: INT4) → INT4 | Identify the minimum selected value. |
| min(arg1: INT8) → INT8 | Identify the minimum selected value. |
| min(arg1: interval) → interval | Identify the minimum selected value. |
| min(arg1: STRING) → STRING | Identify the minimum selected value. |
| min(arg1: time) → time | Identify the minimum selected value. |
| min(arg1: timestamp) → timestamp | Identify the minimum selected value. |
| min(arg1: timestamptz) → timestamptz | Identify the minimum selected value. |
| min(arg1: UUID) → UUID | Identify the minimum selected value. |
| min(arg1: jsonb) → jsonb | Identify the minimum selected value. |
| min(arg1: oid) → oid | Identify the minimum selected value. |
| min(arg1: timetz) → timetz | Identify the minimum selected value. |
| min(arg1: varbit) → varbit | Identify the minimum selected value. |
| sqrdiff(arg1: decimal) → decimal | Calculate the sum of squared differences from the mean of the selected values. |
| sqrdiff(arg1: FLOAT4) → FLOAT8 | Calculate the sum of squared differences from the mean of the selected values. |
| sqrdiff(arg1: FLOAT8) → FLOAT8 | Calculate the sum of squared differences from the mean of the selected values. |
| sqrdiff(arg1: INT2) → decimal | Calculate the sum of squared differences from the mean of the selected values. |
| sqrdiff(arg1: INT4) → decimal | Calculate the sum of squared differences from the mean of the selected values. |
| sqrdiff(arg1: INT8) → decimal | Calculate the sum of squared differences from the mean of the selected values. |
| stddev(arg1: decimal) → decimal | Calculate the standard deviation of the selected values. |
| stddev(arg1: FLOAT4) → FLOAT8 | Calculate the standard deviation of the selected values. |
| stddev(arg1: FLOAT8) → FLOAT8 | Calculate the standard deviation of the selected values. |
| stddev(arg1: INT2) → decimal | Calculate the standard deviation of the selected values. |
| stddev(arg1: INT4) → decimal | Calculate the standard deviation of the selected values. |
| stddev(arg1: INT8) → decimal | Calculate the standard deviation of the selected values. |
| stddev_samp(arg1: decimal) → decimal | Calculate the standard deviation of the selected values. |
| stddev_samp(arg1: FLOAT4) → FLOAT8 | Calculate the standard deviation of the selected values. |
| stddev_samp(arg1: FLOAT8) → FLOAT8 | Calculate the standard deviation of the selected values. |
| stddev_samp(arg1: INT2) → decimal | Calculate the standard deviation of the selected values. |
| stddev_samp(arg1: INT4) → decimal | Calculate the standard deviation of the selected values. |
| stddev_samp(arg1: INT8) → decimal | Calculate the standard deviation of the selected values. |
| STRING_agg(arg1: bytes, arg2: bytes) → bytes | Concatenate all selected values using the provided delimiter. |
| STRING_agg(arg1: STRING, arg2: STRING) → STRING | Concatenate all selected values using the provided delimiter. |
| SUM(arg1: decimal) → decimal | Calculate the sum of the selected values. |
| SUM(arg1: FLOAT4) → FLOAT8 | Calculate the sum of the selected values. |
| SUM(arg1: FLOAT8) → FLOAT8 | Calculate the sum of the selected values. |
| SUM(arg1: INT2) → decimal | Calculate the sum of the selected values. |
| SUM(arg1: INT4) → decimal | Calculate the sum of the selected values. |
| SUM(arg1: INT8) → decimal | Calculate the sum of the selected values. |
| SUM(arg1: interval) → interval | Calculate the sum of the selected values. |
| SUM_INT(arg1: INT2) → INT8 | Calculate the sum of the selected values. |
| SUM_INT(arg1: INT4) → INT8 | Calculate the sum of the selected values. |
| SUM_INT(arg1: INT8) → INT8 | Calculate the sum of the selected values. |
| variance(arg1: decimal) → decimal | Calculate the variance of the selected values. |
| variance(arg1: FLOAT4) → FLOAT8 | Calculate the variance of the selected values. |
| variance(arg1: FLOAT8) → FLOAT8 | Calculate the variance of the selected values. |
| variance(arg1: INT2) → decimal | Calculate the variance of the selected values. |
| variance(arg1: INT4) → decimal | Calculate the variance of the selected values. |
| variance(arg1: INT8) → decimal | Calculate the variance of the selected values. |
| xor_agg(arg1: bytes) → bytes | Calculate the bitwise XOR of the selected values. |
| xor_agg(arg1: INT2) → INT8 | Calculate the bitwise XOR of the selected values. |
| xor_agg(arg1: INT4) → INT8 | Calculate the bitwise XOR of the selected values. |
| xor_agg(arg1: INT8) → INT8 | Calculate the bitwise XOR of the selected values. |
| matching(val: INT2, excludeRule: INT8, lowerBound: decimal, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. Parameters: - excludeRule: Whether to include the upper limit or lower limit in condition judgment. Supported values: 0 means all is included; 1 means only the upper limit is included; 2 means only the lower limit is included. 3 means none is included. - percentage: If the default percentage is 90%, then input 90. |
| matching(val: INT4, excludeRule: INT8, lowerBound: decimal, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. Parameters: - excludeRule: Whether to include the upper limit or lower limit in condition judgment. Supported values: 0 means all is included; 1 means only the upper limit is included; 2 means only the lower limit is included. 3 means none is included. - percentage: If the default percentage is 90%, then input 90. |
| matching(val: INT8, excludeRule: INT8, lowerBound: decimal, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. Parameters: - excludeRule: Whether to include the upper limit or lower limit in condition judgment. Supported values: 0 means all is included; 1 means only the upper limit is included; 2 means only the lower limit is included. 3 means none is included. - percentage: If the default percentage is 90%, then input 90. |
| matching(val: FLOAT4, excludeRule: INT8, lowerBound: decimal, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: FLOAT8, excludeRule: INT8, lowerBound: decimal, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: decimal, excludeRule: INT8, lowerBound: decimal, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: INT2, excludeRule: INT8, lowerBound: STRING, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: INT4, excludeRule: INT8, lowerBound: STRING, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: INT8, excludeRule: INT8, lowerBound: STRING, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: FLOAT4, excludeRule: INT8, lowerBound: STRING, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: FLOAT8, excludeRule: INT8, lowerBound: STRING, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: decimal, excludeRule: INT8, lowerBound: STRING, upperBound: decimal, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: INT2, excludeRule: INT8, lowerBound: decimal, upperBound: STRING, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: INT4, excludeRule: INT8, lowerBound: decimal, upperBound: STRING, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: INT8, excludeRule: INT8, lowerBound: decimal, upperBound: STRING, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: FLOAT4, excludeRule: INT8, lowerBound: decimal, upperBound: STRING, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: FLOAT8, excludeRule: INT8, lowerBound: decimal, upperBound: STRING, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| matching(val: decimal, excludeRule: INT8, lowerBound: decimal, upperBound: STRING, percentage: INT8) → BOOL | Return true if the ratio of the number of values satisfying the condition to the total number is greater than a predefined percentage. Otherwise, return false. |
| interpolate(method, mode) | The interpolate function, working with the time_bucket_gapfill() function. The type of the interpolate result is identical to that of the original value. Parameters: - method: interpolate algorithm, only supporting aggregate functions and numeric data type. - mode: interpolate mode, supporting constant, prev, next, linear, and null. |
Window Functions
| Function → Returns | Description |
|---|---|
| cume_dist() → FLOAT8 | Calculate the relative rank of the current row: (number of rows preceding or peer with current row) / (total rows). |
| dense_rank() → INT8 | Calculate the rank of the current row without gaps. This function counts peer groups. |
| first_value(val: BOOL) → BOOL | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: bytes) → bytes | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: date) → date | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: decimal) → decimal | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: FLOAT4) → FLOAT4 | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: FLOAT8) → FLOAT8 | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: INET) → INET | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: INT2) → INT2 | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: INT4) → INT4 | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: INT8) → INT8 | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: interval) → interval | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: STRING) → STRING | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: time) → time | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: timestamp) → timestamp | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: timestamptz) → timestamptz | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: UUID) → UUID | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: jsonb) → jsonb | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: oid) → oid | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: timetz) → timetz | Return val evaluated at the row that is the first row of the window frame. |
| first_value(val: varbit) → varbit | Return val evaluated at the row that is the first row of the window frame. |
| lag(val: BOOL) → BOOL | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: BOOL, n: INT8) → BOOL | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: BOOL, n: INT8, default: BOOL) → BOOL | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: bytes) → bytes | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: bytes, n: INT8) → bytes | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: bytes, n: INT8, default: bytes) → bytes | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: date) → date | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: date, n: INT8) → date | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: date, n: INT8, default: date) → date | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: decimal) → decimal | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: decimal, n: INT8) → decimal | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: decimal, n: INT8, default: decimal) → decimal | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: FLOAT4) → FLOAT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: FLOAT8) → FLOAT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: FLOAT4, n: INT8) → FLOAT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: FLOAT8, n: INT8) → FLOAT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: FLOAT4, n: INT8, default: FLOAT4) → FLOAT8 | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: FLOAT8, n: INT8, default: FLOAT8) → FLOAT8 | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: INET) → INET | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: INET, n: INT8) → INET | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: INET, n: INT8, default: INET) → INET | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: INT2) → INT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: INT4) → INT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: INT8) → INT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: INT2, n: INT8) → INT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: INT4, n: INT8) → INT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: INT8, n: INT8) → INT8 | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: INT2, n: INT8, default: INT2) → INT8 | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: INT4, n: INT8, default: INT4) → INT8 | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: INT8, n: INT8, default: INT8) → INT8 | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: interval) → interval | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: interval, n: INT8) → interval | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: interval, n: INT8, default: interval) → interval | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: STRING) → STRING | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: STRING, n: INT8) → STRING | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: STRING, n: INT8, default: STRING) → STRING | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: time) → time | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: time, n: INT8) → time | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: time, n: INT8, default: time) → time | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: timestamp) → timestamp | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: timestamp, n: INT8) → timestamp | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: timestamp, n: INT8, default: timestamp) → timestamp | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: timestamptz) → timestamptz | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: timestamptz, n: INT8) → timestamptz | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: timestamptz, n: INT8, default: timestamptz) → timestamptz | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: UUID) → UUID | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: UUID, n: INT8) → UUID | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: UUID, n: INT8, default: UUID) → UUID | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: jsonb) → jsonb | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: jsonb, n: INT8) → jsonb | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: jsonb, n: INT8, default: jsonb) → jsonb | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: oid) → oid | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: oid, n: INT8) → oid | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: oid, n: INT8, default: oid) → oid | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: timetz) → timetz | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: timetz, n: INT8) → timetz | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: timetz, n: INT8, default: timetz) → timetz | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lag(val: varbit) → varbit | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. |
| lag(val: varbit, n: INT8) → varbit | Return val evaluated at the previous row within current row's partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lag(val: varbit, n: INT8, default: varbit) → varbit | Return val evaluated at the row that is n rows before the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| last_value(val: BOOL) → BOOL | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: bytes) → bytes | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: date) → date | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: decimal) → decimal | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: FLOAT4) → FLOAT4 | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: FLOAT8) → FLOAT8 | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: INET) → INET | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: INT2) → INT2 | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: INT4) → INT4 | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: INT8) → INT8 | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: interval) → interval | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: STRING) → STRING | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: time) → time | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: timestamp) → timestamp | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: timestamptz) → timestamptz | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: UUID) → UUID | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: jsonb) → jsonb | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: oid) → oid | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: timetz) → timetz | Return val evaluated at the row that is the last row of the window frame. |
| last_value(val: varbit) → varbit | Return val evaluated at the row that is the last row of the window frame. |
| lead(val: BOOL) → BOOL | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: BOOL, n: INT8) → BOOL | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: BOOL, n: INT8, default: BOOL) → BOOL | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: bytes) → bytes | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: bytes, n: INT8) → bytes | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: bytes, n: INT8, default: bytes) → bytes | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: date) → date | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: date, n: INT8) → date | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: date, n: INT8, default: date) → date | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: decimal) → decimal | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: decimal, n: INT8) → decimal | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: decimal, n: INT8, default: decimal) → decimal | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: FLOAT4) → FLOAT8 | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: FLOAT8) → FLOAT8 | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: FLOAT4, n: INT8) → FLOAT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: FLOAT8, n: INT8) → FLOAT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: FLOAT4, n: INT8, default: FLOAT4) → FLOAT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: FLOAT8, n: INT8, default: FLOAT8) → FLOAT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: INET) → INET | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: INET, n: INT8) → INET | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: INET, n: INT8, default: INET) → INET | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: INT2) → INT8 | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: INT4) → INT8 | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: INT8) → INT8 | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: INT2, n: INT8) → INT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: INT4, n: INT8) → INT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: INT8, n: INT8) → INT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: INT2, n: INT8, default: INT2) → INT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: INT4, n: INT8, default: INT4) → INT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: INT8, n: INT8, default: INT8) → INT8 | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: interval) → interval | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: interval, n: INT8) → interval | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: interval, n: INT8, default: interval) → interval | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: STRING) → STRING | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: STRING, n: INT8) → STRING | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: STRING, n: INT8, default: STRING) → STRING | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: time) → time | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: time, n: INT8) → time | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: time, n: INT8, default: time) → time | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: timestamp) → timestamp | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: timestamp, n: INT8) → timestamp | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: timestamp, n: INT8, default: timestamp) → timestamp | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: timestamptz) → timestamptz | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: timestamptz, n: INT8) → timestamptz | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: timestamptz, n: INT8, default: timestamptz) → timestamptz | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: UUID) → UUID | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: UUID, n: INT8) → UUID | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: UUID, n: INT8, default: UUID) → UUID | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: jsonb) → jsonb | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: jsonb, n: INT8) → jsonb | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: jsonb, n: INT8, default: jsonb) → jsonb | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: oid) → oid | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: oid, n: INT8) → oid | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: oid, n: INT8, default: oid) → oid | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: timetz) → timetz | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: timetz, n: INT8) → timetz | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: timetz, n: INT8, default: timetz) → timetz | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| lead(val: varbit) → varbit | Return val evaluated at the following row within current row's partition. If there is no such row, return null. |
| lead(val: varbit, n: INT8) → varbit | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return null. n is evaluated with respect to the current row. |
| lead(val: varbit, n: INT8, default: varbit) → varbit | Return val evaluated at the row that is n rows after the current row within its partition. If there is no such row, return default (which must be of the same type as val). Both n and default are evaluated with respect to the current row. |
| nth_value(val: BOOL, n: INT8) → BOOL | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: bytes, n: INT8) → bytes | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: date, n: INT8) → date | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: decimal, n: INT8) → decimal | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: FLOAT4, n: INT8) → FLOAT8 | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: FLOAT8, n: INT8) → FLOAT8 | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: INET, n: INT8) → INET | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: INT2, n: INT8) → INT8 | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: INT4, n: INT8) → INT8 | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: INT8, n: INT8) → INT8 | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: interval, n: INT8) → interval | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: STRING, n: INT8) → STRING | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: time, n: INT8) → time | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: timestamp, n: INT8) → timestamp | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: timestamptz, n: INT8) → timestamptz | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: UUID, n: INT8) → UUID | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: jsonb, n: INT8) → jsonb | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: oid, n: INT8) → oid | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: timetz, n: INT8) → timetz | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| nth_value(val: varbit, n: INT8) → varbit | Return val evaluated at the row that is the nth row of the window frame (counting from 1). If there is no such row, return null. |
| ntile(n: INT2) → INT8 | Calculate an integer ranging from 1 to n, dividing the partition as equally as possible. |
| ntile(n: INT4) → INT8 | Calculate an integer ranging from 1 to n, dividing the partition as equally as possible. |
| ntile(n: INT8) → INT8 | Calculate an integer ranging from 1 to n, dividing the partition as equally as possible. |
| percent_rank() → FLOAT8 | Calculate the relative rank of the current row: (rank - 1) / (total rows - 1). |
| rank() → INT8 | Calculate the rank of the current row with gaps. Same as the row_number of its first peer. |
| row_number() → INT8 | Calculate the number of the current row within its partition, counting from 1. |