- atan2 ( <replaceable>y> double precision,
- <replaceable>x> double precision )
+ atan2 ( <parameter>y> double precision,
+ <parameter>x> double precision )
double precision
Inverse tangent of
- <replaceable>y/x>,
result in radians
- atan2d ( <replaceable>y> double precision,
- <replaceable>x> double precision )
+ atan2d ( <parameter>y> double precision,
+ <parameter>x> double precision )
double precision
Inverse tangent of
- <replaceable>y/x>,
result in degrees
|
-
substring (
string text FROM <
replaceable>pattern> text )
+
substring (
string text FROM <
parameter>pattern> text )
text
|
-
substring (
string text FROM <
replaceable>pattern text FOR escape> text )
+
substring (
string text FROM <
parameter>pattern text FOR escape> text )
text
text
- Returns first <replaceable>n> characters in the
- string, or when <replaceable>n> is negative, returns
- all but last |<replaceable>n>| characters.
+ Returns first <parameter>n> characters in the
+ string, or when <parameter>n> is negative, returns
+ all but last |<parameter>n>| characters.
left('abcde', 2)
text
- Returns last <replaceable>n> characters in the string,
- or when <replaceable>n> is negative, returns all but
- first |<replaceable>n>| characters.
+ Returns last <parameter>n> characters in the string,
+ or when <parameter>n> is negative, returns all but
+ first |<parameter>n>| characters.
right('abcde', 2)
format(
formatstr text [,
formatarg "any" [, ...] ])
- <replaceable>formatstr> is a format string that specifies how the
+ <parameter>formatstr> is a format string that specifies how the
result should be formatted. Text in the format string is copied
directly to the result, except where format specifiers are
used. Format specifiers act as placeholders in the string, defining how
subsequent function arguments should be formatted and inserted into the
- result. Each <replaceable>formatarg> argument is converted to text
+ result. Each <parameter>formatarg> argument is converted to text
according to the usual output rules for its data type, and then formatted
and inserted into the result string according to the format specifier(s).
Format specifiers are introduced by a % character and have
the form
-%[<replaceable>position][flags][width]type>
+%[<
parameter>position][flags][width]type>
where the component fields are:
- <replaceable>position> (optional)
+ <parameter>position> (optional)
- A string of the form <replaceable>n>$ where
- <replaceable>n> is the index of the argument to print.
+ A string of the form <parameter>n>$ where
+ <parameter>n> is the index of the argument to print.
Index 1 means the first argument after
- <replaceable>formatstr. If the position> is
+ <
parameter>formatstr. If the position> is
omitted, the default is to use the next argument in sequence.
- <replaceable>flags> (optional)
+ <parameter>flags> (optional)
Additional options controlling how the format specifier's output is
formatted. Currently the only supported flag is a minus sign
(-) which will cause the format specifier's output to be
- left-justified. This has no effect unless the <replaceable>width>
+ left-justified. This has no effect unless the <parameter>width>
field is also specified.
- <replaceable>width> (optional)
+ <parameter>width> (optional)
Specifies the minimum number of characters to use to
truncation of the output, but is simply ignored. The width may be
specified using any of the following: a positive integer; an
asterisk (*) to use the next function argument as the
- width; or a string of the form *<replaceable>n>$ to
- use the <replaceable>n>th function argument as the width.
+ width; or a string of the form *<parameter>n>$ to
+ use the <parameter>n>th function argument as the width.
consumed before the argument that is used for the format specifier's
value. If the width argument is negative, the result is left
aligned (as if the - flag had been specified) within a
- field of length abs(<replaceable>width>).
+ field of length abs(<parameter>width>).
- <replaceable>type> (required)
+ <parameter>type> (required)
The type of format conversion to use to produce the format
- Here are examples using <replaceable>width> fields
+ Here are examples using <parameter>width> fields
and the - flag:
- These examples show use of <replaceable>position> fields:
+ These examples show use of <parameter>position> fields:
SELECT format('Testing %3$s, %2$s, %1$s', 'one', 'two', 'three');
Unlike the standard C function sprintf,
PostgreSQL's
format function allows format
- specifiers with and without <replaceable>position> fields to be mixed
+ specifiers with and without <parameter>position> fields to be mixed
in the same format string. A format specifier without a
- <replaceable>position> field always uses the next argument after the
+ <parameter>position> field always uses the next argument after the
last argument consumed.
In addition, the format function does not require all
function arguments to be used in the format string.
plainto_tsquery (
- <replaceable>config> regconfig,
- <replaceable>query> text )
+ <parameter>config> regconfig,
+ <parameter>query> text )
tsquery
phraseto_tsquery (
- <replaceable>config> regconfig,
- <replaceable>query> text )
+ <parameter>config> regconfig,
+ <parameter>query> text )
tsquery
websearch_to_tsquery (
- <replaceable>config> regconfig,
- <replaceable>query> text )
+ <parameter>config> regconfig,
+ <parameter>query> text )
tsquery
- setweight ( <replaceable>vector tsvector, weight> "char" )
+
setweight ( <
parameter>vector tsvector, weight> "char" )
tsvector
- Assigns the specified <replaceable>weight> to each element
- of the <replaceable>vector>.
+ Assigns the specified <parameter>weight> to each element
+ of the <parameter>vector>.
setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A')
setweight for specific lexeme(s)
- setweight ( <replaceable>vector tsvector, weight "char", lexemes> text[] )
+
setweight ( <
parameter>vector tsvector, weight "char", lexemes> text[] )
tsvector
- Assigns the specified <replaceable>weight> to elements
- of the <replaceable>vector> that are listed
- in <replaceable>lexemes>.
+ Assigns the specified <parameter>weight> to elements
+ of the <parameter>vector> that are listed
+ in <parameter>lexemes>.
setweight('fat:2,4 cat:3 rat:5,6B'::tsvector, 'A', '{cat,rat}')
to_tsquery (
- <replaceable>config> regconfig,
- <replaceable>query> text )
+ <parameter>config> regconfig,
+ <parameter>query> text )
tsquery
to_tsvector (
- <replaceable>config> regconfig,
- <replaceable>document> text )
+ <parameter>config> regconfig,
+ <parameter>document> text )
tsvector
|
to_tsvector (
- <replaceable>config> regconfig,
- <replaceable>document> json )
+ <parameter>config> regconfig,
+ <parameter>document> json )
tsvector
to_tsvector (
- <replaceable>config> regconfig,
- <replaceable>document> jsonb )
+ <parameter>config> regconfig,
+ <parameter>document> jsonb )
tsvector
json_to_tsvector (
- <replaceable>config> regconfig,
- <replaceable>document> json,
- <replaceable>filter> jsonb )
+ <parameter>config> regconfig,
+ <parameter>document> json,
+ <parameter>filter> jsonb )
tsvector
jsonb_to_tsvector (
- <replaceable>config> regconfig,
- <replaceable>document> jsonb,
- <replaceable>filter> jsonb )
+ <parameter>config> regconfig,
+ <parameter>document> jsonb,
+ <parameter>filter> jsonb )
tsvector
Selects each item in the JSON document that is requested by
- the <replaceable>filter> and converts each one to
+ the <parameter>filter> and converts each one to
a tsvector, normalizing words according to the specified
or default configuration. The results are then concatenated in
document order to produce the output. Position information is
items. (Beware that document order
of the fields of a
JSON object is implementation-dependent when the input
is jsonb.)
- The <replaceable>filter> must be a jsonb
+ The <parameter>filter> must be a jsonb
array containing zero or more of these keywords:
"string" (to include all string values),
"numeric" (to include all numeric values),
"boolean" (to include all boolean values),
"key" (to include all keys), or
"all" (to include all the above).
- As a special case, the <replaceable>filter> can also be a
+ As a special case, the <parameter>filter> can also be a
simple JSON value that is one of these keywords.
- ts_delete ( <replaceable>vector tsvector, lexeme> text )
+
ts_delete ( <
parameter>vector tsvector, lexeme> text )
tsvector
- Removes any occurrence of the given <replaceable>lexeme>
- from the <replaceable>vector>.
+ Removes any occurrence of the given <parameter>lexeme>
+ from the <parameter>vector>.
ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, 'fat')
|
- ts_delete ( <replaceable>vector tsvector, lexemes> text[] )
+
ts_delete ( <
parameter>vector tsvector, lexemes> text[] )
tsvector
Removes any occurrences of the lexemes
- in <replaceable>lexemes>
- from the <replaceable>vector>.
+ in <parameter>lexemes>
+ from the <parameter>vector>.
ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, ARRAY['fat','rat'])
- ts_filter ( <replaceable>vector tsvector, weights> "char"[] )
+
ts_filter ( <
parameter>vector tsvector, weights> "char"[] )
tsvector
- Selects only elements with the given <replaceable>weights>
- from the <replaceable>vector>.
+ Selects only elements with the given <parameter>weights>
+ from the <parameter>vector>.
ts_filter('fat:2,4 cat:3b,7c rat:5A'::tsvector, '{a,b}')
ts_headline (
- <replaceable>config> regconfig,
- <replaceable>document> text,
- <replaceable>query> tsquery
- , <replaceable>options> text )
+ <parameter>config> regconfig,
+ <parameter>document> text,
+ <parameter>query> tsquery
+ , <parameter>options> text )
text
Displays, in an abbreviated form, the match(es) for
- the <replaceable>query> in
- the <replaceable>document>, which must be raw text not
+ the <parameter>query> in
+ the <parameter>document>, which must be raw text not
a tsvector. Words in the document are normalized
according to the specified or default configuration before matching to
the query. Use of this function is discussed in
, which also describes the
- available <replaceable>options>.
+ available <parameter>options>.
ts_headline('The fat cat ate the rat.', 'cat')
|
ts_headline (
- <replaceable>config> regconfig,
- <replaceable>document> json,
- <replaceable>query> tsquery
- , <replaceable>options> text )
+ <parameter>config> regconfig,
+ <parameter>document> json,
+ <parameter>query> tsquery
+ , <parameter>options> text )
text
ts_headline (
- <replaceable>config> regconfig,
- <replaceable>document> jsonb,
- <replaceable>query> tsquery
- , <replaceable>options> text )
+ <parameter>config> regconfig,
+ <parameter>document> jsonb,
+ <parameter>query> tsquery
+ , <parameter>options> text )
text
Displays, in an abbreviated form, match(es) for
- the <replaceable>query> that occur in string values
- within the JSON <replaceable>document>.
+ the <parameter>query> that occur in string values
+ within the JSON <parameter>document>.
See for more details.
ts_rank (
- <replaceable>weights> real[],
- <replaceable>vector> tsvector,
- <replaceable>query> tsquery
- , <replaceable>normalization> integer )
+ <parameter>weights> real[],
+ <parameter>vector> tsvector,
+ <parameter>query> tsquery
+ , <parameter>normalization> integer )
real
Computes a score showing how well
- the <replaceable>vector> matches
- the <replaceable>query>. See
+ the <parameter>vector> matches
+ the <parameter>query>. See
for details.
ts_rank_cd (
- <replaceable>weights> real[],
- <replaceable>vector> tsvector,
- <replaceable>query> tsquery
- , <replaceable>normalization> integer )
+ <parameter>weights> real[],
+ <parameter>vector> tsvector,
+ <parameter>query> tsquery
+ , <parameter>normalization> integer )
real
Computes a score showing how well
- the <replaceable>vector> matches
- the <replaceable>query>, using a cover density
+ the <parameter>vector> matches
+ the <parameter>query>, using a cover density
algorithm. See for details.
- ts_rewrite ( <replaceable>query> tsquery,
- <replaceable>target> tsquery,
- <replaceable>substitute> tsquery )
+ ts_rewrite ( <parameter>query> tsquery,
+ <parameter>target> tsquery,
+ <parameter>substitute> tsquery )
tsquery
- Replaces occurrences of <replaceable>target>
- with <replaceable>substitute>
- within the <replaceable>query>.
+ Replaces occurrences of <parameter>target>
+ with <parameter>substitute>
+ within the <parameter>query>.
See for details.
|
- ts_rewrite ( <replaceable>query> tsquery,
- <replaceable>select> text )
+ ts_rewrite ( <parameter>query> tsquery,
+ <parameter>select> text )
tsquery
- Replaces portions of the <replaceable>query> according to
+ Replaces portions of the <parameter>query> according to
target(s) and substitute(s) obtained by executing
a SELECT command.
See for details.
- tsquery_phrase ( <replaceable>query1 tsquery, query2> tsquery )
+
tsquery_phrase ( <
parameter>query1 tsquery, query2> tsquery )
tsquery
Constructs a phrase query that searches
- for matches of <replaceable>query1>
- and <replaceable>query2> at successive lexemes (same
+ for matches of <parameter>query1>
+ and <parameter>query2> at successive lexemes (same
as <-> operator).
|
- tsquery_phrase ( <replaceable>query1 tsquery, query2 tsquery, distance> integer )
+
tsquery_phrase ( <
parameter>query1 tsquery, query2 tsquery, distance> integer )
tsquery
Constructs a phrase query that searches
- for matches of <replaceable>query1> and
- <replaceable>query2> that occur exactly
- <replaceable>distance> lexemes apart.
+ for matches of <parameter>query1> and
+ <parameter>query2> that occur exactly
+ <parameter>distance> lexemes apart.
tsquery_phrase(to_tsquery('fat'), to_tsquery('cat'), 10)
unnest ( tsvector )
setof record
- ( <replaceable>lexeme> text,
- <replaceable>positions> smallint[],
- <replaceable>weights> text )
+ ( <parameter>lexeme> text,
+ <parameter>positions> smallint[],
+ <parameter>weights> text )
Expands a tsvector into a set of rows, one per lexeme.
ts_debug (
- <replaceable>config> regconfig,
- <replaceable>document> text )
+ <parameter>config> regconfig,
+ <parameter>document> text )
setof record
- ( <replaceable>alias> text,
- <replaceable>description> text,
- <replaceable>token> text,
- <replaceable>dictionaries> regdictionary[],
- <replaceable>dictionary> regdictionary,
- <replaceable>lexemes> text[] )
+ ( <parameter>alias> text,
+ <parameter>description> text,
+ <parameter>token> text,
+ <parameter>dictionaries> regdictionary[],
+ <parameter>dictionary> regdictionary,
+ <parameter>lexemes> text[] )
Extracts and normalizes tokens from
- the <replaceable>document> according to the specified or
+ the <parameter>document> according to the specified or
default text search configuration, and returns information about how
each token was processed.
See for details.
- ts_lexize ( <replaceable>dict regdictionary, token> text )
+
ts_lexize ( <
parameter>dict regdictionary, token> text )
text[]
- ts_parse ( <replaceable>parser_name> text,
- <replaceable>document> text )
+ ts_parse ( <parameter>parser_name> text,
+ <parameter>document> text )
setof record
- ( <replaceable>tokid> integer,
- <replaceable>token> text )
+ ( <parameter>tokid> integer,
+ <parameter>token> text )
- Extracts tokens from the <replaceable>document> using the
+ Extracts tokens from the <parameter>document> using the
named parser.
See for details.
|
- ts_parse ( <replaceable>parser_oid> oid,
- <replaceable>document> text )
+ ts_parse ( <parameter>parser_oid> oid,
+ <parameter>document> text )
setof record
- ( <replaceable>tokid> integer,
- <replaceable>token> text )
+ ( <parameter>tokid> integer,
+ <parameter>token> text )
- Extracts tokens from the <replaceable>document> using a
+ Extracts tokens from the <parameter>document> using a
parser specified by OID.
See for details.
- ts_token_type ( <replaceable>parser_name> text )
+ ts_token_type ( <parameter>parser_name> text )
setof record
- ( <replaceable>tokid> integer,
- <replaceable>alias> text,
- <replaceable>description> text )
+ ( <parameter>tokid> integer,
+ <parameter>alias> text,
+ <parameter>description> text )
Returns a table that describes each type of token the named parser can
|
- ts_token_type ( <replaceable>parser_oid> oid )
+ ts_token_type ( <parameter>parser_oid> oid )
setof record
- ( <replaceable>tokid> integer,
- <replaceable>alias> text,
- <replaceable>description> text )
+ ( <parameter>tokid> integer,
+ <parameter>alias> text,
+ <parameter>description> text )
Returns a table that describes each type of token a parser specified
- ts_stat ( <replaceable>sqlquery> text
- , <replaceable>weights> text )
+ ts_stat ( <parameter>sqlquery> text
+ , <parameter>weights> text )
setof record
- ( <replaceable>word> text,
- <replaceable>ndoc> integer,
- <replaceable>nentry> integer )
+ ( <parameter>word> text,
+ <parameter>ndoc> integer,
+ <parameter>nentry> integer )
- Executes the <replaceable>sqlquery>, which must return a
+ Executes the <parameter>sqlquery>, which must return a
single tsvector column, and returns statistics about each
distinct lexeme contained in the data.
See for details.
-xpath ( <replaceable>xpath text, xml xml , nsarray> text[] ) xml[]
+
xpath ( <
parameter>xpath text, xml xml , nsarray> text[] ) xml[]
The function xpath evaluates the XPath 1.0
- expression <replaceable>xpath> (given as text)
+ expression <parameter>xpath> (given as text)
against the XML value
- <replaceable>xml>. It returns an array of XML values
+ <parameter>xml>. It returns an array of XML values
corresponding to the node-set produced by the XPath expression.
If the XPath expression returns a scalar value rather than a node-set,
a single-element array is returned.
-xpath_exists ( <replaceable>xpath text, xml xml , nsarray> text[] ) boolean
+
xpath_exists ( <
parameter>xpath text, xml xml , nsarray> text[] ) boolean
The following functions map the contents of relational tables to
XML values. They can be thought of as XML export functionality:
-table_to_xml ( <replaceable>table regclass, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-query_to_xml ( <replaceable>query text, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-cursor_to_xml ( <replaceable>cursor refcursor, count integer, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
+
table_to_xml ( <
parameter>table regclass, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+
query_to_xml ( <
parameter>query text, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+
cursor_to_xml ( <
parameter>cursor refcursor, count integer, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
table_to_xml maps the content of the named
- table, passed as parameter <replaceable>table>. The
+ table, passed as parameter <parameter>table>. The
regclass type accepts strings identifying tables using the
usual notation, including optional schema qualifications and
double quotes. query_to_xml executes the
query whose text is passed as parameter
- <replaceable>query> and maps the result set.
+ <parameter>query> and maps the result set.
cursor_to_xml fetches the indicated number of
rows from the cursor specified by the parameter
- <replaceable>cursor>. This variant is recommended if
+ <parameter>cursor>. This variant is recommended if
large tables have to be mapped, because the result value is built
up in memory by each function.
- If <replaceable>tableforest> is false, then the resulting
+ If <parameter>tableforest> is false, then the resulting
XML document looks like this:
]]>
- If <replaceable>tableforest> is true, the result is an
+ If <parameter>tableforest> is true, the result is an
XML content fragment that looks like this:
- The parameter <replaceable>nulls> determines whether null
+ The parameter <parameter>nulls> determines whether null
values should be included in the output. If true, null values in
columns are represented as:
- The parameter <replaceable>targetns> specifies the
+ The parameter <parameter>targetns> specifies the
desired XML namespace of the result. If no particular namespace
is wanted, an empty string should be passed.
The following functions return XML Schema documents describing the
mappings performed by the corresponding functions above:
-table_to_xmlschema ( <replaceable>table regclass, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-query_to_xmlschema ( <replaceable>query text, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-cursor_to_xmlschema ( <replaceable>cursor refcursor, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
+
table_to_xmlschema ( <
parameter>table regclass, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+
query_to_xmlschema ( <
parameter>query text, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+
cursor_to_xmlschema ( <
parameter>cursor refcursor, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
It is essential that the same parameters are passed in order to
obtain matching XML data mappings and XML Schema documents.
together. They can be useful where self-contained and
self-describing results are wanted:
-table_to_xml_and_xmlschema ( <replaceable>table regclass, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-query_to_xml_and_xmlschema ( <replaceable>query text, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
+
table_to_xml_and_xmlschema ( <
parameter>table regclass, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+
query_to_xml_and_xmlschema ( <
parameter>query text, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
analogous mappings of entire schemas or the entire current
database:
-schema_to_xml ( <replaceable>schema name, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-schema_to_xmlschema ( <replaceable>schema name, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-schema_to_xml_and_xmlschema ( <replaceable>schema name, nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-
-database_to_xml ( <replaceable>nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-database_to_xmlschema ( <replaceable>nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
-database_to_xml_and_xmlschema ( <replaceable>nulls> boolean,
- <replaceable>tableforest boolean, targetns> text ) xml
+
schema_to_xml ( <
parameter>schema name, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+
schema_to_xmlschema ( <
parameter>schema name, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+
schema_to_xml_and_xmlschema ( <
parameter>schema name, nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+
+database_to_xml ( <parameter>nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+database_to_xmlschema ( <parameter>nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
+database_to_xml_and_xmlschema ( <parameter>nulls> boolean,
+ <
parameter>tableforest boolean, targetns> text ) xml
These functions ignore tables that are not readable by the current user.
jsonb
- Extracts <replaceable>n>'th element of JSON array
+ Extracts <parameter>n>'th element of JSON array
(array elements are indexed from zero, but negative integers count
from the end).
text
- Extracts <replaceable>n>'th element of JSON array,
+ Extracts <parameter>n>'th element of JSON array,
as text.
|
- json_object ( <replaceable>keys text[], values> text[] )
+
json_object ( <
parameter>keys text[], values> text[] )
json
- jsonb_object ( <replaceable>keys text[], values> text[] )
+
jsonb_object ( <
parameter>keys text[], values> text[] )
jsonb
json_each ( json )
- setof key text,
- value json
+ setof record
jsonb_each ( jsonb )
- setof key text,
- value jsonb
+ setof record
Expands the top-level JSON object into a set of key/value pairs.
json_each_text ( json )
- setof key text,
- value text
+ setof record
jsonb_each_text ( jsonb )
- setof key text,
- value text
+ setof record
Expands the top-level JSON object into a set of key/value pairs.
- The returned <replaceable>value>s will be of
+ The returned <parameter>value>s will be of
type text.
- json_extract_path ( <replaceable>from_json json, VARIADIC path_elems> text[] )
+
json_extract_path ( <
parameter>from_json json, VARIADIC path_elems> text[] )
json
- jsonb_extract_path ( <replaceable>from_json jsonb, VARIADIC path_elems> text[] )
+
jsonb_extract_path ( <
parameter>from_json jsonb, VARIADIC path_elems> text[] )
jsonb
- json_extract_path_text ( <replaceable>from_json json, VARIADIC path_elems> text[] )
+
json_extract_path_text ( <
parameter>from_json json, VARIADIC path_elems> text[] )
text
- jsonb_extract_path_text ( <replaceable>from_json jsonb, VARIADIC path_elems> text[] )
+
jsonb_extract_path_text ( <
parameter>from_json jsonb, VARIADIC path_elems> text[] )
text
- json_populate_record ( <replaceable>base anyelement, from_json> json )
+
json_populate_record ( <
parameter>base anyelement, from_json> json )
anyelement
- jsonb_populate_record ( <replaceable>base anyelement, from_json> jsonb )
+
jsonb_populate_record ( <
parameter>base anyelement, from_json> jsonb )
anyelement
Expands the top-level JSON object to a row having the composite type
- of the <replaceable>base> argument. The JSON object
+ of the <parameter>base> argument. The JSON object
is scanned for fields whose names match column names of the output row
type, and their values are inserted into those columns of the output.
(Fields that do not correspond to any output column name are ignored.)
- In typical use, the value of <replaceable>base> is just
+ In typical use, the value of <parameter>base> is just
NULL, which means that any output columns that do
not match any object field will be filled with nulls. However,
- if <replaceable>base> isn't NULL then
+ if <parameter>base> isn't NULL then
the values it contains will be used for unmatched columns.
- json_populate_recordset ( <replaceable>base anyelement, from_json> json )
+
json_populate_recordset ( <
parameter>base anyelement, from_json> json )
setof anyelement
- jsonb_populate_recordset ( <replaceable>base anyelement, from_json> jsonb )
+
jsonb_populate_recordset ( <
parameter>base anyelement, from_json> jsonb )
setof anyelement
Expands the top-level JSON array of objects to a set of rows having
- the composite type of the <replaceable>base> argument.
+ the composite type of the <parameter>base> argument.
Each element of the JSON array is processed as described above
for json[b]_populate_record.
- jsonb_set ( <replaceable>target jsonb, path text[], new_value jsonb , create_if_missing> boolean )
+
jsonb_set ( <
parameter>target jsonb, path text[], new_value jsonb , create_if_missing> boolean )
jsonb
- Returns <replaceable>target>
- with the item designated by <replaceable>path>
- replaced by <replaceable>new_value>, or with
- <replaceable>new_value> added if
- <replaceable>create_if_missing> is true (which is the
- default) and the item designated by <replaceable>path>
+ Returns <parameter>target>
+ with the item designated by <parameter>path>
+ replaced by <parameter>new_value>, or with
+ <parameter>new_value> added if
+ <parameter>create_if_missing> is true (which is the
+ default) and the item designated by <parameter>path>
does not exist.
All earlier steps in the path must exist, or
- the <replaceable>target> is returned unchanged.
+ the <parameter>target> is returned unchanged.
As with the path oriented operators, negative integers that
- appear in the <replaceable>path> count from the end
+ appear in the <parameter>path> count from the end
of JSON arrays.
If the last path step is an array index that is out of range,
- and <replaceable>create_if_missing> is true, the new
+ and <parameter>create_if_missing> is true, the new
value is added at the beginning of the array if the index is negative,
or at the end of the array if it is positive.
- jsonb_set_lax ( <replaceable>target jsonb, path text[], new_value jsonb , create_if_missing boolean , null_value_treatment> text )
+
jsonb_set_lax ( <
parameter>target jsonb, path text[], new_value jsonb , create_if_missing boolean , null_value_treatment> text )
jsonb
- If <replaceable>new_value> is not NULL,
+ If <parameter>new_value> is not NULL,
behaves identically to jsonb_set. Otherwise behaves
according to the value
- of <replaceable>null_value_treatment> which must be one
+ of <parameter>null_value_treatment> which must be one
of 'raise_exception',
'use_json_null', 'delete_key', or
'return_target'. The default is
- jsonb_insert ( <replaceable>target jsonb, path text[], new_value jsonb , insert_after> boolean )
+
jsonb_insert ( <
parameter>target jsonb, path text[], new_value jsonb , insert_after> boolean )
jsonb
- Returns <replaceable>target>
- with <replaceable>new_value> inserted. If the item
- designated by the <replaceable>path> is an array
- element, <replaceable>new_value> will be inserted before
- that item if <replaceable>insert_after> is false (which
+ Returns <parameter>target>
+ with <parameter>new_value> inserted. If the item
+ designated by the <parameter>path> is an array
+ element, <parameter>new_value> will be inserted before
+ that item if <parameter>insert_after> is false (which
is the default), or after it
- if <replaceable>insert_after> is true. If the item
- designated by the <replaceable>path> is an object
- field, <replaceable>new_value> will be inserted only if
+ if <parameter>insert_after> is true. If the item
+ designated by the <parameter>path> is an object
+ field, <parameter>new_value> will be inserted only if
the object does not already contain that key.
All earlier steps in the path must exist, or
- the <replaceable>target> is returned unchanged.
+ the <parameter>target> is returned unchanged.
As with the path oriented operators, negative integers that
- appear in the <replaceable>path> count from the end
+ appear in the <parameter>path> count from the end
of JSON arrays.
If the last path step is an array index that is out of range, the new
value is added at the beginning of the array if the index is negative,
- jsonb_path_exists ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_exists ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
boolean
Checks whether the JSON path returns any item for the specified JSON
value.
- If the <replaceable>vars> argument is specified, it must
+ If the <parameter>vars> argument is specified, it must
be a JSON object, and its fields provide named values to be
substituted into the jsonpath expression.
- If the <replaceable>silent> argument is specified and
+ If the <parameter>silent> argument is specified and
is true, the function suppresses the same errors
as the @? and @@ operators do.
- jsonb_path_match ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_match ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
boolean
Returns the result of a JSON path predicate check for the specified
JSON value. Only the first item of the result is taken into account.
If the result is not Boolean, then NULL is returned.
- The optional <replaceable>vars>
- and <replaceable>silent> arguments act the same as
+ The optional <parameter>vars>
+ and <parameter>silent> arguments act the same as
for jsonb_path_exists.
- jsonb_path_query ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_query ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
setof jsonb
Returns all JSON items returned by the JSON path for the specified
JSON value.
- The optional <replaceable>vars>
- and <replaceable>silent> arguments act the same as
+ The optional <parameter>vars>
+ and <parameter>silent> arguments act the same as
for jsonb_path_exists.
- jsonb_path_query_array ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_query_array ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
jsonb
Returns all JSON items returned by the JSON path for the specified
JSON value, as a JSON array.
- The optional <replaceable>vars>
- and <replaceable>silent> arguments act the same as
+ The optional <parameter>vars>
+ and <parameter>silent> arguments act the same as
for jsonb_path_exists.
- jsonb_path_query_first ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_query_first ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
jsonb
Returns the first JSON item returned by the JSON path for the
specified JSON value. Returns NULL if there are no
results.
- The optional <replaceable>vars>
- and <replaceable>silent> arguments act the same as
+ The optional <parameter>vars>
+ and <parameter>silent> arguments act the same as
for jsonb_path_exists.
- jsonb_path_exists_tz ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_exists_tz ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
boolean
- jsonb_path_match_tz ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_match_tz ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
boolean
- jsonb_path_query_tz ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_query_tz ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
setof jsonb
jsonb_path_query_array_tz
- jsonb_path_query_array_tz ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_query_array_tz ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
jsonb
jsonb_path_query_first_tz
- jsonb_path_query_first_tz ( <replaceable>target jsonb, path jsonpath , vars jsonb , silent> boolean )
+
jsonb_path_query_first_tz ( <
parameter>target jsonb, path jsonpath , vars jsonb , silent> boolean )
jsonb
- array_to_string ( <replaceable>array anyarray, delimiter text , null_string> text )
+
array_to_string ( <
parameter>array anyarray, delimiter text , null_string> text )
text
Converts each array element to its text representation, and
concatenates those separated by
- the <replaceable>delimiter> string.
- If <replaceable>null_string> is given and is
+ the <parameter>delimiter> string.
+ If <parameter>null_string> is given and is
not NULL, then NULL array
entries are represented by that string; otherwise, they are omitted.
- string_to_array ( <replaceable>string text, delimiter text , null_string> text )
+
string_to_array ( <
parameter>string text, delimiter text , null_string> text )
text[]
- Splits the <replaceable>string> at occurrences
- of <replaceable>delimiter> and forms the remaining data
+ Splits the <parameter>string> at occurrences
+ of <parameter>delimiter> and forms the remaining data
into a text array.
- If <replaceable>delimiter> is NULL,
- each character in the <replaceable>string> will become a
+ If <parameter>delimiter> is NULL,
+ each character in the <parameter>string> will become a
separate element in the array.
- If <replaceable>delimiter> is an empty string, then
- the <replaceable>string> is treated as a single field.
- If <replaceable>null_string> is supplied and is
+ If <parameter>delimiter> is an empty string, then
+ the <parameter>string> is treated as a single field.
+ If <parameter>null_string> is supplied and is
not NULL, fields matching that string are converted
to NULL entries.
- json_object_agg ( <replaceable>key>
- "any", <replaceable>value>
+ json_object_agg ( <parameter>key>
+ "any", <parameter>value>
"any" )
json
- jsonb_object_agg ( <replaceable>key>
- "any", <replaceable>value>
+ jsonb_object_agg ( <parameter>key>
+ "any", <parameter>value>
"any" )
jsonb
- string_agg ( <replaceable>value>
- text, <replaceable>delimiter> text )
+ string_agg ( <parameter>value>
+ text, <parameter>delimiter> text )
text
- string_agg ( <replaceable>value>
- bytea, <replaceable>delimiter> bytea )
+ string_agg ( <parameter>value>
+ bytea, <parameter>delimiter> bytea )
bytea
Concatenates the non-null input values into a string. Each value
after the first is preceded by the
- corresponding <replaceable>delimiter> (if it's not null).
+ corresponding <parameter>delimiter> (if it's not null).
No
bigint, numeric, real,
and double precision.
Where the description mentions
- <replaceable class="parameter">N>, it means the
+ <parameter>N>, it means the
number of input rows for which all the input expressions are non-null.
In all cases, null is returned if the computation is meaningless,
- for example when <replaceable class="parameter">N> is zero.
+ for example when <parameter>N> is zero.
- corr ( <replaceable>Y double precision, X> double precision )
+
corr ( <
parameter>Y double precision, X> double precision )
double precision
- covar_pop ( <replaceable>Y double precision, X> double precision )
+
covar_pop ( <
parameter>Y double precision, X> double precision )
double precision
- covar_samp ( <replaceable>Y double precision, X> double precision )
+
covar_samp ( <
parameter>Y double precision, X> double precision )
double precision
- regr_avgx ( <replaceable>Y double precision, X> double precision )
+
regr_avgx ( <
parameter>Y double precision, X> double precision )
double precision
Computes the average of the independent variable,
- sum(<replaceable>X)/N>.
Yes
- regr_avgy ( <replaceable>Y double precision, X> double precision )
+
regr_avgy ( <
parameter>Y double precision, X> double precision )
double precision
Computes the average of the dependent variable,
- sum(<replaceable>Y)/N>.
Yes
- regr_count ( <replaceable>Y double precision, X> double precision )
+
regr_count ( <
parameter>Y double precision, X> double precision )
bigint
- regr_intercept ( <replaceable>Y double precision, X> double precision )
+
regr_intercept ( <
parameter>Y double precision, X> double precision )
double precision
Computes the y-intercept of the least-squares-fit linear equation
determined by the
- (<replaceable>X, Y>) pairs.
+ (<
parameter>X, Y>) pairs.
Yes
- regr_r2 ( <replaceable>Y double precision, X> double precision )
+
regr_r2 ( <
parameter>Y double precision, X> double precision )
double precision
- regr_slope ( <replaceable>Y double precision, X> double precision )
+
regr_slope ( <
parameter>Y double precision, X> double precision )
double precision
Computes the slope of the least-squares-fit linear equation determined
- by the (<replaceable>X, Y>)
+ by the (<
parameter>X, Y>)
pairs.
Yes
- regr_sxx ( <replaceable>Y double precision, X> double precision )
+
regr_sxx ( <
parameter>Y double precision, X> double precision )
double precision
Computes the sum of squares
of the independent
variable,
- sum(<replaceable>X^2) - sum(X)^2/N>.
+
sum(<parameter>X^2) - sum(X)^2/N>.
Yes
- regr_sxy ( <replaceable>Y double precision, X> double precision )
+
regr_sxy ( <
parameter>Y double precision, X> double precision )
double precision
Computes the sum of products
of independent times
dependent variables,
- sum(<replaceable>X*Y) - sum(X) * sum(Y)/N>.
+
sum(<parameter>X*Y) - sum(X) * sum(Y)/N>.
Yes
- regr_syy ( <replaceable>Y double precision, X> double precision )
+
regr_syy ( <
parameter>Y double precision, X> double precision )
double precision
Computes the sum of squares
of the dependent
variable,
- sum(<replaceable>Y^2) - sum(Y)^2/N>.
+
sum(<parameter>Y^2) - sum(Y)^2/N>.
Yes
ORDER BY, and they may also take a direct
argument that is not aggregated, but is computed only once.
All these functions ignore null values in their aggregated input.
- For those that take a <replaceable>fraction> parameter, the
+ For those that take a <parameter>fraction> parameter, the
fraction value must be between 0 and 1; an error is thrown if not.
- However, a null <replaceable>fraction> value simply produces a
+ However, a null <parameter>fraction> value simply produces a
null result.
continuous
- percentile_cont ( <replaceable>fraction> double precision ) WITHIN GROUP ( ORDER BY double precision )
+ percentile_cont ( <parameter>fraction> double precision ) WITHIN GROUP ( ORDER BY double precision )
double precision
- percentile_cont ( <replaceable>fraction> double precision ) WITHIN GROUP ( ORDER BY interval )
+ percentile_cont ( <parameter>fraction> double precision ) WITHIN GROUP ( ORDER BY interval )
interval
Computes the continuous percentile, a value
- corresponding to the specified <replaceable>fraction>
+ corresponding to the specified <parameter>fraction>
within the ordered set of aggregated argument values. This will
interpolate between adjacent input items if needed.
|
- percentile_cont ( <replaceable>fractions> double precision[] ) WITHIN GROUP ( ORDER BY double precision )
+ percentile_cont ( <parameter>fractions> double precision[] ) WITHIN GROUP ( ORDER BY double precision )
double precision[]
- percentile_cont ( <replaceable>fractions> double precision[] ) WITHIN GROUP ( ORDER BY interval )
+ percentile_cont ( <parameter>fractions> double precision[] ) WITHIN GROUP ( ORDER BY interval )
interval[]
Computes multiple continuous percentiles. The result is an array of
- the same dimensions as the <replaceable>fractions>
+ the same dimensions as the <parameter>fractions>
parameter, with each non-null element replaced by the (possibly
interpolated) value corresponding to that percentile.
discrete
- percentile_disc ( <replaceable>fraction> double precision ) WITHIN GROUP ( ORDER BY anyelement )
+ percentile_disc ( <parameter>fraction> double precision ) WITHIN GROUP ( ORDER BY anyelement )
anyelement
Computes the discrete percentile, the first
value within the ordered set of aggregated argument values whose
position in the ordering equals or exceeds the
- specified <replaceable>fraction>. The aggregated
+ specified <parameter>fraction>. The aggregated
argument must be of a sortable type.
No
|
- percentile_disc ( <replaceable>fractions> double precision[] ) WITHIN GROUP ( ORDER BY anyelement )
+ percentile_disc ( <parameter>fractions> double precision[] ) WITHIN GROUP ( ORDER BY anyelement )
anyarray
Computes multiple discrete percentiles. The result is an array of the
- same dimensions as the <replaceable>fractions> parameter,
+ same dimensions as the <parameter>fractions> parameter,
with each non-null element replaced by the input value corresponding
to that percentile.
The aggregated argument must be of a sortable type.
Computes the cumulative distribution, that is (number of rows
preceding or peers with hypothetical row) / (total rows). The value
- thus ranges from 1/<replaceable>N> to 1.
+ thus ranges from 1/<parameter>N> to 1.
No
Returns the cumulative distribution, that is (number of partition rows
preceding or peers with current row) / (total partition rows).
- The value thus ranges from 1/<replaceable>N> to 1.
+ The value thus ranges from 1/<parameter>N> to 1.
- ntile ( <replaceable>num_buckets> integer )
+ ntile ( <parameter>num_buckets> integer )
integer
- lag ( <replaceable>value> anyelement
- , <replaceable>offset> integer
- , <replaceable>default> anyelement )
+ lag ( <parameter>value> anyelement
+ , <parameter>offset> integer
+ , <parameter>default> anyelement )
anyelement
- Returns <replaceable>value> evaluated at
- the row that is <replaceable>offset>
+ Returns <parameter>value> evaluated at
+ the row that is <parameter>offset>
rows before the current row within the partition; if there is no such
- row, instead returns <replaceable>default>
+ row, instead returns <parameter>default>
(which must be of the same type as
- <replaceable>value>).
- Both <replaceable>offset> and
- <replaceable>default> are evaluated
+ <parameter>value>).
+ Both <parameter>offset> and
+ <parameter>default> are evaluated
with respect to the current row. If omitted,
- <replaceable>offset> defaults to 1 and
- <replaceable>default> to NULL.
+ <parameter>offset> defaults to 1 and
+ <parameter>default> to NULL.
- lead ( <replaceable>value> anyelement
- , <replaceable>offset> integer
- , <replaceable>default> anyelement )
+ lead ( <parameter>value> anyelement
+ , <parameter>offset> integer
+ , <parameter>default> anyelement )
anyelement
- Returns <replaceable>value> evaluated at
- the row that is <replaceable>offset>
+ Returns <parameter>value> evaluated at
+ the row that is <parameter>offset>
rows after the current row within the partition; if there is no such
- row, instead returns <replaceable>default>
+ row, instead returns <parameter>default>
(which must be of the same type as
- <replaceable>value>).
- Both <replaceable>offset> and
- <replaceable>default> are evaluated
+ <parameter>value>).
+ Both <parameter>offset> and
+ <parameter>default> are evaluated
with respect to the current row. If omitted,
- <replaceable>offset> defaults to 1 and
- <replaceable>default> to NULL.
+ <parameter>offset> defaults to 1 and
+ <parameter>default> to NULL.
- first_value ( <replaceable>value> anyelement )
+ first_value ( <parameter>value> anyelement )
anyelement
- Returns <replaceable>value> evaluated
+ Returns <parameter>value> evaluated
at the row that is the first row of the window frame.
- last_value ( <replaceable>value> anyelement )
+ last_value ( <parameter>value> anyelement )
anyelement
- Returns <replaceable>value> evaluated
+ Returns <parameter>value> evaluated
at the row that is the last row of the window frame.
- nth_value ( <replaceable>value anyelement, n> integer )
+
nth_value ( <
parameter>value anyelement, n> integer )
anyelement
- Returns <replaceable>value> evaluated
- at the row that is the <replaceable>n>'th
+ Returns <parameter>value> evaluated
+ at the row that is the <parameter>n>'th
row of the window frame (counting from 1);
returns NULL if there is no such row.