# Postgres

[Home](/rezoom-sql/master.md) > [Language](/rezoom-sql/language.md) > [Functions](/rezoom-sql/language/functions.md) > Postgres

[← TSQL](/rezoom-sql/language/functions/tsqlfunctions.md) | [Quirks →](/rezoom-sql/language/quirks.md)

## Postgres functions

This is the complete list of built-in functions supported by the `"postgres"` backend.

Some Postgres functions have been excluded because they operate on data types RZSQL cannot currently model, such as `range` and `array` types. I hope to one day add support for these types, but for now this project is **not** a good fit if you plan to make significant use of these Postgres-specific types.

### abs

```
abs(<numeric> a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### acos

```
acos(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### acosd

```
acosd(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### ascii

```
ascii(STRING^) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### asin

```
asin(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### asind

```
asind(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### atan

```
atan(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### atan2

```
atan2(FLOAT64^, FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### atan2d

```
atan2d(FLOAT64^, FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### atand

```
atand(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### avg

```
avg(<numeric> a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### bit\_and

```
bit_and(<integral> a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### bit\_length

```
bit_length(<stringish> a^) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### bit\_or

```
bit_or(<integral> a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### bool\_and

```
bool_and(BOOL) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### bool\_or

```
bool_or(BOOL) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### btrim

```
btrim(BINARY^, BINARY^{0..1}) -> BINARY
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### cbrt

```
cbrt(<numeric>^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### ceil

```
ceil(<numeric> a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### ceiling

```
ceiling(<numeric> a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### character\_length

```
character_length(STRING^) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### char\_length

```
char_length(STRING^) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### chr

```
chr(INT^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### clock\_timestamp

```
clock_timestamp() -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### coalesce

```
coalesce(a?, a?{0..*}, a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### concat

```
concat(<scalar>, <scalar>{0..*}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### convert

```
convert(BINARY^, STRING^, STRING^) -> BINARY
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### convert\_from

```
convert_from(BINARY^, STRING^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### convert\_to

```
convert_to(STRING^, STRING^) -> BINARY
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### corr

```
corr(FLOAT64, FLOAT64) -> FLOAT64?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### cos

```
cos(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### cosd

```
cosd(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### cot

```
cot(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### cotd

```
cotd(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### count

```
count(<scalar>) -> INT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### covar\_pop

```
covar_pop(FLOAT64, FLOAT64) -> FLOAT64?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### covar\_samp

```
covar_samp(FLOAT64, FLOAT64) -> FLOAT64?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### current\_database

```
current_database() -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### current\_query

```
current_query() -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### current\_schema

```
current_schema() -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### date\_part

```
date_part(STRING^, <datetimeish>^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### date\_trunc

```
date_trunc(STRING^, <datetimeish>^) -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### decode

```
decode(STRING^, STRING^) -> BINARY
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### degrees

```
degrees(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### div

```
div(<numeric> a^, a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### encode

```
encode(BINARY^, STRING^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### every

```
every(BOOL) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### exp

```
exp(<numeric> a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### floor

```
floor(<numeric> a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### format

```
format(STRING^, <scalar>{0..*}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### get\_bit

```
get_bit(BINARY^, INT^) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### get\_byte

```
get_byte(BINARY^, INT^) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### greatest

```
greatest(a^, a^{0..*}) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### grouping

```
grouping(<scalar>, <scalar>{0..*}) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### has\_any\_column\_privilege

```
has_any_column_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_column\_privilege

```
has_column_privilege(STRING^, STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_database\_privilege

```
has_database_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_foreign\_data\_wrapper\_privilege

```
has_foreign_data_wrapper_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_function\_privilege

```
has_function_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_language\_privilege

```
has_language_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_schema\_privilege

```
has_schema_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_sequence\_privilege

```
has_sequence_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_server\_privilege

```
has_server_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_tablespace\_privilege

```
has_tablespace_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_table\_privilege

```
has_table_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### has\_type\_privilege

```
has_type_privilege(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### impure

```
impure(a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | yes    | no        |

### inet\_client\_port

```
inet_client_port() -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### inet\_server\_port

```
inet_server_port() -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### initcap

```
initcap(STRING^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### isfinite

```
isfinite(<datetimeish>^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### json\_agg

```
json_agg(<scalar>) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### json\_object\_agg

```
json_object_agg(STRING, <scalar>) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### lastval

```
lastval() -> <integral>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### least

```
least(a^, a^{0..*}) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### left

```
left(STRING^, INT^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### length

```
length(<stringish> a^, STRING^{0..1}) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### ln

```
ln(<numeric> a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### log

```
log(<numeric> a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### lower

```
lower(STRING^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### lpad

```
lpad(STRING^, INT^, STRING^{0..1}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### ltrim

```
ltrim(STRING^, STRING^{0..1}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### make\_timestamp

```
make_timestamp(INT^, INT^, INT^, INT^, INT^, FLOAT64^) -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### make\_timestamptz

```
make_timestamptz(INT^, INT^, INT^, INT^, INT^, FLOAT64^, STRING^{0..1}) -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### max

```
max(a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### md5

```
md5(<stringish> a^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### min

```
min(a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### mod

```
mod(<integral> a^, a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### now

```
now() -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### nullable

```
nullable(a?) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | yes    | no        |

### nullif

```
nullif(a, a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### octet\_length

```
octet_length(<stringish> a^) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### pg\_backend\_pid

```
pg_backend_pid() -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### pg\_client\_encoding

```
pg_client_encoding() -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### pg\_conf\_load\_time

```
pg_conf_load_time() -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### pg\_has\_role

```
pg_has_role(STRING^, STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### pg\_notification\_queue\_usage

```
pg_notification_queue_usage() -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### pg\_postmaster\_start\_time

```
pg_postmaster_start_time() -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### pg\_trigger\_depth

```
pg_trigger_depth() -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### pi

```
pi() -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### power

```
power(<fractional> a^, a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### quote\_ident

```
quote_ident(STRING^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### quote\_literal

```
quote_literal(<scalar>^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### quote\_nullable

```
quote_nullable(<scalar>) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### radians

```
radians(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### random

```
random() -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### regexp\_replace

```
regexp_replace(STRING^, STRING^, STRING^, STRING^{0..1}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### regr\_avgx

```
regr_avgx(FLOAT64, FLOAT64) -> FLOAT64?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### regr\_avgy

```
regr_avgy(FLOAT64, FLOAT64) -> FLOAT64?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### regr\_count

```
regr_count(FLOAT64, FLOAT64) -> INT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### regr\_intercept

```
regr_intercept(FLOAT64, FLOAT64) -> FLOAT64?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### regr\_r2

```
regr_r2(FLOAT64, FLOAT64) -> FLOAT64?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### regr\_slope

```
regr_slope(FLOAT64, FLOAT64) -> FLOAT64?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### regr\_sxx

```
regr_sxx(FLOAT64, FLOAT64) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### regr\_sxy

```
regr_sxy(FLOAT64, FLOAT64) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### regr\_syy

```
regr_syy(FLOAT64, FLOAT64) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### repeat

```
repeat(STRING^, INT^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### replace

```
replace(STRING^, STRING^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### reverse

```
reverse(STRING^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### right

```
right(STRING^, INT^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### round

```
round(<numeric> a^, INT^{0..1}) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### row\_security\_active

```
row_security_active(STRING^) -> BOOL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### rpad

```
rpad(STRING^, INT^, STRING^{0..1}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### rtrim

```
rtrim(STRING^, STRING^{0..1}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### scale

```
scale(DECIMAL^) -> DECIMAL
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### set\_bit

```
set_bit(BINARY^, INT^, INT^) -> BINARY
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### set\_byte

```
set_byte(BINARY^, INT^, INT^) -> BINARY
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### sign

```
sign(<numeric> a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### sin

```
sin(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### sind

```
sind(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### split\_part

```
split_part(STRING^, STRING^, INT^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### sqrt

```
sqrt(<numeric> a^) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### statement\_timestamp

```
statement_timestamp() -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### stddev

```
stddev(<numeric> a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### stddev\_pop

```
stddev_pop(<numeric> a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### stddev\_samp

```
stddev_samp(<numeric> a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### string\_agg

```
string_agg(<stringish> a, <stringish> a) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### strpos

```
strpos(STRING^, STRING^) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### substr

```
substr(STRING^, INT^, INT^{0..1}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### substring

```
substring(<stringish> a^, INT^, INT^{0..1}) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### sum

```
sum(<numeric> a) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### tan

```
tan(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### tand

```
tand(FLOAT64^) -> FLOAT64
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### timeofday

```
timeofday() -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### to\_ascii

```
to_ascii(STRING^, STRING^{0..1}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### to\_char

```
to_char(<scalar>^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### to\_hex

```
to_hex(<integral>) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### to\_number

```
to_number(STRING^, STRING^) -> <numeric>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### to\_timestamp

```
to_timestamp(FLOAT64^) -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### transaction\_timestamp

```
transaction_timestamp() -> <datetimeish>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### translate

```
translate(STRING^, STRING^, STRING^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### trim

```
trim(STRING^, STRING^{0..1}) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### trunc

```
trunc(<numeric> a^, INT^{0..1}) -> a
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### unsafe\_coerce

```
unsafe_coerce(<scalar>^) -> <scalar>
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | yes    | no        |

### upper

```
upper(STRING^) -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

### variance

```
variance(<numeric> a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### var\_pop

```
var_pop(<numeric> a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### var\_samp

```
var_samp(<numeric> a) -> a?
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | yes       |

### version

```
version() -> STRING
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| no         | no     | no        |

### width\_bucket

```
width_bucket(<numeric>^, <numeric>^, <numeric>^, INT^) -> INT
```

| Idempotent | Erased | Aggregate |
| ---------- | ------ | --------- |
| yes        | no     | no        |

***

[← TSQL](/rezoom-sql/language/functions/tsqlfunctions.md) | [Quirks →](/rezoom-sql/language/quirks.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://humbobst.gitbook.io/rezoom-sql/language/functions/postgresfunctions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
