Search PostgreSQL documentation
PG 18 · Browse by category, or enter a name or keyword
Category index908
quote_identquote_ident
String Functions And Operators
10
Return the given string suitably quoted to be used as an identifier in an SQL statement string. Quotes are added only if necessary (i.e., if the…Functions · String Functions And Operators
quote_literalquote_literal
String Functions And Operators
10
Return the given string suitably quoted to be used as a string literal in an SQL statement string. Embedded single-quotes and backslashes are …Functions · String Functions And Operators
quote_nullablequote_nullable
String Functions And Operators
10
Return the given string suitably quoted to be used as a string literal in an SQL statement string; or, if the argument is null, return NULL. …Functions · String Functions And Operators
radiansradians
Mathematical Functions And Operators
10
degrees to radians
radians ( dp ) → dp degrees to radians
11
12
13
Converts degrees to radians
radians ( double precision ) → double precision…Functions · Mathematical Functions And Operators
radiusradius
Geometric Functions And Operators
10
radius of circle
radius ( circle ) → double precision radius of circle
11
12
13
Computes radius of circle.
radius ( circle ) → double precision Co…Functions · Geometric Functions And Operators
randomrandom
Mathematical Functions And Operators
10
random value in the range 0.0 <= x < 1.0
random ( ) → dp random value in the range 0.0 <= x < 1.0
11
12
13
Returns a random value in the range …Functions · Mathematical Functions And Operators
random_exponentialrandom_exponential ( lb, ub, parameter ) → integer Computes an exponentially-distributed random integer in [lb, ub], see below. random_exponential(1, 10, 3.0) → an integer between 1 and 10pgbench › Notes › Built-In Functions
random_gaussianrandom_gaussian ( lb, ub, parameter ) → integer Computes a Gaussian-distributed random integer in [lb, ub], see below. random_gaussian(1, 10, 2.5) → an integer between 1 and 10pgbench › Notes › Built-In Functions
random_normalrandom_normal
Mathematical Functions And Operators
16
Returns a random value from the normal distribution with the given parameters; mean defaults to 0.0 and stddev defaults to 1.0
random_no…Functions · Mathematical Functions And Operators
random_zipfianrandom_zipfian ( lb, ub, parameter ) → integer Computes a Zipfian-distributed random integer in [lb, ub], see below. random_zipfian(1, 10, 1.5) → an integer between 1 and 10pgbench › Notes › Built-In Functions
range_aggrange_agg
Aggregate Functions
14
Computes the union of the non-null input values.
range_agg ( value anyrange ) → anymultirange Computes the union of the non-null input values.
15
range_agg (…Functions · Aggregate Functions
range_intersect_aggrange_intersect_agg
Aggregate Functions
14
Computes the intersection of the non-null input values.
range_intersect_agg ( value anyrange ) → anyrange Computes the intersection of the non-null…Functions · Aggregate Functions
range_mergerange_merge
Range/Multirange Functions And Operators
10
the smallest range which includes both of the given ranges
range_merge ( anyrange, anyrange ) → anyrange the smallest range which incl…Functions · Range/Multirange Functions And Operators
range_minus_multirange_minus_multi
Range/Multirange Functions And Operators
19
Returns the non-empty range(s) remaining after subtracting the second range from the first. One row is returned for each range, …Functions · Range/Multirange Functions And Operators
rankrank
Aggregate Functions
10
rank of the hypothetical row, with gaps for duplicate rows
rank ( args ) WITHIN GROUP (ORDER BY sorted_args) → bigint rank of the hypothetical row, with gaps for …Functions · Aggregate Functions
regexp_countregexp_count
String Functions And Operators
15
Returns the number of times the POSIX regular expression pattern matches in the string; see Section 9.7.3.
regexp_count ( string text, pattern …Functions · String Functions And Operators
regexp_instrregexp_instr
String Functions And Operators
15
Returns the position within string where the N'th match of the POSIX regular expression pattern occurs, or zero if there is no such match; see …Functions · String Functions And Operators
regexp_likeregexp_like
String Functions And Operators
15
Checks whether a match of the POSIX regular expression pattern occurs within string; see Section 9.7.3.
regexp_like ( string text, pattern text …Functions · String Functions And Operators
regexp_matchregexp_match
String Functions And Operators
10
Return captured substring(s) resulting from the first match of a POSIX regular expression to the string. See Section 9.7.3 for more information…Functions · String Functions And Operators
regexp_matchesregexp_matches
String Functions And Operators
10
Return captured substring(s) resulting from matching a POSIX regular expression to the string. See Section 9.7.3 for more information.
regexp…Functions · String Functions And Operators
regexp_replaceregexp_replace
String Functions And Operators
10
Replace substring(s) matching a POSIX regular expression. See Section 9.7.3 for more information.
regexp_replace ( string text, pattern text,…Functions · String Functions And Operators
regexp_split_to_arrayregexp_split_to_array
String Functions And Operators
10
Split string using a POSIX regular expression as the delimiter. See Section 9.7.3 for more information.
regexp_split_to_array ( string…Functions · String Functions And Operators
regexp_split_to_tableregexp_split_to_table
String Functions And Operators
10
Split string using a POSIX regular expression as the delimiter. See Section 9.7.3 for more information.
regexp_split_to_table ( string…Functions · String Functions And Operators
regexp_substrregexp_substr
String Functions And Operators
15
Returns the substring within string that matches the N'th occurrence of the POSIX regular expression pattern, or NULL if there is no such matc…Functions · String Functions And Operators
regr_avgxregr_avgx
Aggregate Functions
10
average of the independent variable (sum(X)/N)
regr_avgx ( Y, X ) → double precision average of the independent variable (sum(X)/N)
11
12
13
Computes the ave…Functions · Aggregate Functions
regr_avgyregr_avgy
Aggregate Functions
10
average of the dependent variable (sum(Y)/N)
regr_avgy ( Y, X ) → double precision average of the dependent variable (sum(Y)/N)
11
12
13
Computes the average…Functions · Aggregate Functions
regr_countregr_count
Aggregate Functions
10
number of input rows in which both expressions are nonnull
regr_count ( Y, X ) → bigint number of input rows in which both expressions are nonnull
11
12
13
…Functions · Aggregate Functions
regr_interceptregr_intercept
Aggregate Functions
10
y-intercept of the least-squares-fit linear equation determined by the (X, Y) pairs
regr_intercept ( Y, X ) → double precision y-intercept of the least-…Functions · Aggregate Functions
regr_r2regr_r2
Aggregate Functions
10
square of the correlation coefficient
regr_r2 ( Y, X ) → double precision square of the correlation coefficient
11
12
13
Computes the square of the correlation…Functions · Aggregate Functions
regr_sloperegr_slope
Aggregate Functions
10
slope of the least-squares-fit linear equation determined by the (X, Y) pairs
regr_slope ( Y, X ) → double precision slope of the least-squares-fit linear e…Functions · Aggregate Functions
regr_sxxregr_sxx
Aggregate Functions
10
sum(X^2) - sum(X)^2/N (“sum of squares” of the independent variable)
regr_sxx ( Y, X ) → double precision sum(X^2) - sum(X)^2/N (“sum of squares” of the indep…Functions · Aggregate Functions
regr_sxyregr_sxy
Aggregate Functions
10
sum(X*Y) - sum(X) * sum(Y)/N (“sum of products” of independent times dependent variable)
regr_sxy ( Y, X ) → double precision sum(X*Y) - sum(X) * sum(Y)/N (“s…Functions · Aggregate Functions
regr_syyregr_syy
Aggregate Functions
10
sum(Y^2) - sum(Y)^2/N (“sum of squares” of the dependent variable)
regr_syy ( Y, X ) → double precision sum(Y^2) - sum(Y)^2/N (“sum of squares” of the depende…Functions · Aggregate Functions
repeatrepeat
String Functions And Operators
10
Repeat string the specified number of times
repeat ( string text, number int ) → text Repeat string the specified number of times
11
12
13
Repeats st…Functions · String Functions And Operators
replacereplace
String Functions And Operators
10
Replace all occurrences in string of substring from with substring to
replace ( string text, from text, to text ) → text Replace all occurrences in …Functions · String Functions And Operators
reversereverse
String Functions And Operators
10
Return reversed string.
reverse ( str ) → text Return reversed string.
11
12
13
Reverses the order of the characters in the string.
reverse ( text )…Functions · String Functions And Operators
rightright
String Functions And Operators
10
Return last n characters in the string. When n is negative, return all but first |n| characters.
right ( str text, n int ) → text Return last n charac…Functions · String Functions And Operators
roundround
Mathematical Functions And Operators
10
round to nearest integer
round ( dp or numeric ) → (same as input) round to nearest integer
round ( v numeric, s int ) → numeric round to s deci…Functions · Mathematical Functions And Operators
row_numberrow_number
Window Functions
10
number of the current row within its partition, counting from 1
row_number ( ) → bigint number of the current row within its partition, counting from 1
11
12
1…Functions · Window Functions
row_security_activerow_security_active
System Information Functions And Operators
10
does current user have row level security active for table
row_security_active ( table ) → boolean does current user have ro…Functions · System Information Functions And Operators
More results
Find definitions in the PostgreSQL manuals, reference library, and extension catalogue.
pg17: choose a version ex: extensions only ↑↓ select ↵ open