summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorPeter Eisentraut2023-04-05 06:55:44 +0000
committerPeter Eisentraut2023-04-05 07:20:25 +0000
commitc9f57541d9705da44b9fbcb6e0c75dec3b41b57c (patch)
tree29436696d545f82e6591ee78625ffcdb59cca9a2 /doc/src
parentfb6fad6ef1bb94b5bfde01a83951ad7eda7764bc (diff)
doc: Update SQL features/conformance information to SQL:2023
Optional subfeatures have been changed to top-level features, so there is a bit of a churn in the list for that. Some existing functions have been added to the standard, so they are moved from the "other" to the "standard" lists in their sections. Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/datatype.sgml3
-rw-r--r--doc/src/sgml/features.sgml17
-rw-r--r--doc/src/sgml/func.sgml344
3 files changed, 181 insertions, 183 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index f6b867f344..8d32a8c9c5 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -1242,8 +1242,7 @@ SELECT '52093.89'::money::numeric::float8;
than zero and cannot exceed 10485760.
<type>character</type> without length specifier is equivalent to
<type>character(1)</type>. If <type>character varying</type> is used
- without length specifier, the type accepts strings of any size. The
- latter behavior is a <productname>PostgreSQL</productname> extension.
+ without length specifier, the type accepts strings of any size.
</para>
<para>
diff --git a/doc/src/sgml/features.sgml b/doc/src/sgml/features.sgml
index b98056214f..575afa3476 100644
--- a/doc/src/sgml/features.sgml
+++ b/doc/src/sgml/features.sgml
@@ -14,9 +14,9 @@
<para>
The formal name of the SQL standard is ISO/IEC 9075 <quote>Database
Language SQL</quote>. A revised version of the standard is released
- from time to time; the most recent update appearing in 2016.
- The 2016 version is referred to as ISO/IEC 9075:2016, or simply as SQL:2016.
- The versions prior to that were SQL:2011, SQL:2008, SQL:2006, SQL:2003,
+ from time to time; the most recent update appearing in 2023.
+ The 2023 version is referred to as ISO/IEC 9075:2023, or simply as SQL:2023.
+ The versions prior to that were SQL:2016, SQL:2011, SQL:2008, SQL:2006, SQL:2003,
SQL:1999, and SQL-92. Each version
replaces the previous one, so claims of conformance to earlier
versions have no official merit.
@@ -62,6 +62,7 @@
<listitem><para>ISO/IEC 9075-13 Routines and Types using the Java Language (SQL/JRT)</para><indexterm><primary>SQL/JRT</primary></indexterm></listitem>
<listitem><para>ISO/IEC 9075-14 XML-related specifications (SQL/XML)</para><indexterm><primary>SQL/XML</primary></indexterm></listitem>
<listitem><para>ISO/IEC 9075-15 Multi-dimensional arrays (SQL/MDA)</para><indexterm><primary>SQL/MDA</primary></indexterm></listitem>
+ <listitem><para>ISO/IEC 9075-16 Property Graph Queries (SQL/PGQ)</para><indexterm><primary>SQL/PGQ</primary></indexterm></listitem>
</itemizedlist>
Note that some part numbers are not (or no longer) used.
@@ -72,23 +73,23 @@
11, and 14. Part 3 is covered by the ODBC driver, and part 13 is
covered by the PL/Java plug-in, but exact conformance is currently
not being verified for these components. There are currently no
- implementations of parts 4, 10, and 15
+ implementations of parts 4, 10, 15, and 16
for <productname>PostgreSQL</productname>.
</para>
<para>
- PostgreSQL supports most of the major features of SQL:2016. Out of
+ PostgreSQL supports most of the major features of SQL:2023. Out of
177 mandatory features required for full Core conformance,
PostgreSQL conforms to at least 170. In addition, there is a long
list of supported optional features. It might be worth noting that at
the time of writing, no current version of any database management
- system claims full conformance to Core SQL:2016.
+ system claims full conformance to Core SQL:2023.
</para>
<para>
In the following two sections, we provide a list of those features
that <productname>PostgreSQL</productname> supports, followed by a
- list of the features defined in <acronym>SQL:2016</acronym> which
+ list of the features defined in <acronym>SQL:2023</acronym> which
are not yet supported in <productname>PostgreSQL</productname>.
Both of these lists are approximate: There might be minor details that
are nonconforming for a feature that is listed as supported, and
@@ -135,7 +136,7 @@
<title>Unsupported Features</title>
<para>
- The following features defined in <acronym>SQL:2016</acronym> are not
+ The following features defined in <acronym>SQL:2023</acronym> are not
implemented in this release of
<productname>PostgreSQL</productname>. In a few cases, equivalent
functionality is available.
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 918a492234..dc44a74eb2 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -2455,6 +2455,26 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>btrim</primary>
+ </indexterm>
+ <function>btrim</function> ( <parameter>string</parameter> <type>text</type>
+ <optional>, <parameter>characters</parameter> <type>text</type> </optional> )
+ <returnvalue>text</returnvalue>
+ </para>
+ <para>
+ Removes the longest string containing only characters
+ in <parameter>characters</parameter> (a space by default)
+ from the start and end of <parameter>string</parameter>.
+ </para>
+ <para>
+ <literal>btrim('xyxtrimyyx', 'xyz')</literal>
+ <returnvalue>trim</returnvalue>
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>normalized</primary>
</indexterm>
<indexterm>
@@ -2550,6 +2570,49 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>lpad</primary>
+ </indexterm>
+ <function>lpad</function> ( <parameter>string</parameter> <type>text</type>,
+ <parameter>length</parameter> <type>integer</type>
+ <optional>, <parameter>fill</parameter> <type>text</type> </optional> )
+ <returnvalue>text</returnvalue>
+ </para>
+ <para>
+ Extends the <parameter>string</parameter> to length
+ <parameter>length</parameter> by prepending the characters
+ <parameter>fill</parameter> (a space by default). If the
+ <parameter>string</parameter> is already longer than
+ <parameter>length</parameter> then it is truncated (on the right).
+ </para>
+ <para>
+ <literal>lpad('hi', 5, 'xy')</literal>
+ <returnvalue>xyxhi</returnvalue>
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
+ <primary>ltrim</primary>
+ </indexterm>
+ <function>ltrim</function> ( <parameter>string</parameter> <type>text</type>
+ <optional>, <parameter>characters</parameter> <type>text</type> </optional> )
+ <returnvalue>text</returnvalue>
+ </para>
+ <para>
+ Removes the longest string containing only characters in
+ <parameter>characters</parameter> (a space by default) from the start of
+ <parameter>string</parameter>.
+ </para>
+ <para>
+ <literal>ltrim('zzzytest', 'xyz')</literal>
+ <returnvalue>test</returnvalue>
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>normalize</primary>
</indexterm>
<indexterm>
@@ -2653,6 +2716,49 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>rpad</primary>
+ </indexterm>
+ <function>rpad</function> ( <parameter>string</parameter> <type>text</type>,
+ <parameter>length</parameter> <type>integer</type>
+ <optional>, <parameter>fill</parameter> <type>text</type> </optional> )
+ <returnvalue>text</returnvalue>
+ </para>
+ <para>
+ Extends the <parameter>string</parameter> to length
+ <parameter>length</parameter> by appending the characters
+ <parameter>fill</parameter> (a space by default). If the
+ <parameter>string</parameter> is already longer than
+ <parameter>length</parameter> then it is truncated.
+ </para>
+ <para>
+ <literal>rpad('hi', 5, 'xy')</literal>
+ <returnvalue>hixyx</returnvalue>
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
+ <primary>rtrim</primary>
+ </indexterm>
+ <function>rtrim</function> ( <parameter>string</parameter> <type>text</type>
+ <optional>, <parameter>characters</parameter> <type>text</type> </optional> )
+ <returnvalue>text</returnvalue>
+ </para>
+ <para>
+ Removes the longest string containing only characters in
+ <parameter>characters</parameter> (a space by default) from the end of
+ <parameter>string</parameter>.
+ </para>
+ <para>
+ <literal>rtrim('testxxzx', 'xyz')</literal>
+ <returnvalue>test</returnvalue>
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>substring</primary>
</indexterm>
<function>substring</function> ( <parameter>string</parameter> <type>text</type> <optional> <literal>FROM</literal> <parameter>start</parameter> <type>integer</type> </optional> <optional> <literal>FOR</literal> <parameter>count</parameter> <type>integer</type> </optional> )
@@ -2845,26 +2951,6 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>btrim</primary>
- </indexterm>
- <function>btrim</function> ( <parameter>string</parameter> <type>text</type>
- <optional>, <parameter>characters</parameter> <type>text</type> </optional> )
- <returnvalue>text</returnvalue>
- </para>
- <para>
- Removes the longest string containing only characters
- in <parameter>characters</parameter> (a space by default)
- from the start and end of <parameter>string</parameter>.
- </para>
- <para>
- <literal>btrim('xyxtrimyyx', 'xyz')</literal>
- <returnvalue>trim</returnvalue>
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>chr</primary>
</indexterm>
<function>chr</function> ( <type>integer</type> )
@@ -3002,49 +3088,6 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>lpad</primary>
- </indexterm>
- <function>lpad</function> ( <parameter>string</parameter> <type>text</type>,
- <parameter>length</parameter> <type>integer</type>
- <optional>, <parameter>fill</parameter> <type>text</type> </optional> )
- <returnvalue>text</returnvalue>
- </para>
- <para>
- Extends the <parameter>string</parameter> to length
- <parameter>length</parameter> by prepending the characters
- <parameter>fill</parameter> (a space by default). If the
- <parameter>string</parameter> is already longer than
- <parameter>length</parameter> then it is truncated (on the right).
- </para>
- <para>
- <literal>lpad('hi', 5, 'xy')</literal>
- <returnvalue>xyxhi</returnvalue>
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
- <primary>ltrim</primary>
- </indexterm>
- <function>ltrim</function> ( <parameter>string</parameter> <type>text</type>
- <optional>, <parameter>characters</parameter> <type>text</type> </optional> )
- <returnvalue>text</returnvalue>
- </para>
- <para>
- Removes the longest string containing only characters in
- <parameter>characters</parameter> (a space by default) from the start of
- <parameter>string</parameter>.
- </para>
- <para>
- <literal>ltrim('zzzytest', 'xyz')</literal>
- <returnvalue>test</returnvalue>
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>md5</primary>
</indexterm>
<function>md5</function> ( <type>text</type> )
@@ -3508,49 +3551,6 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>rpad</primary>
- </indexterm>
- <function>rpad</function> ( <parameter>string</parameter> <type>text</type>,
- <parameter>length</parameter> <type>integer</type>
- <optional>, <parameter>fill</parameter> <type>text</type> </optional> )
- <returnvalue>text</returnvalue>
- </para>
- <para>
- Extends the <parameter>string</parameter> to length
- <parameter>length</parameter> by appending the characters
- <parameter>fill</parameter> (a space by default). If the
- <parameter>string</parameter> is already longer than
- <parameter>length</parameter> then it is truncated.
- </para>
- <para>
- <literal>rpad('hi', 5, 'xy')</literal>
- <returnvalue>hixyx</returnvalue>
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
- <primary>rtrim</primary>
- </indexterm>
- <function>rtrim</function> ( <parameter>string</parameter> <type>text</type>
- <optional>, <parameter>characters</parameter> <type>text</type> </optional> )
- <returnvalue>text</returnvalue>
- </para>
- <para>
- Removes the longest string containing only characters in
- <parameter>characters</parameter> (a space by default) from the end of
- <parameter>string</parameter>.
- </para>
- <para>
- <literal>rtrim('testxxzx', 'xyz')</literal>
- <returnvalue>test</returnvalue>
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>split_part</primary>
</indexterm>
<function>split_part</function> ( <parameter>string</parameter> <type>text</type>,
@@ -4141,6 +4141,46 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
+ <primary>btrim</primary>
+ </indexterm>
+ <function>btrim</function> ( <parameter>bytes</parameter> <type>bytea</type>,
+ <parameter>bytesremoved</parameter> <type>bytea</type> )
+ <returnvalue>bytea</returnvalue>
+ </para>
+ <para>
+ Removes the longest string containing only bytes appearing in
+ <parameter>bytesremoved</parameter> from the start and end of
+ <parameter>bytes</parameter>.
+ </para>
+ <para>
+ <literal>btrim('\x1234567890'::bytea, '\x9012'::bytea)</literal>
+ <returnvalue>\x345678</returnvalue>
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
+ <primary>ltrim</primary>
+ </indexterm>
+ <function>ltrim</function> ( <parameter>bytes</parameter> <type>bytea</type>,
+ <parameter>bytesremoved</parameter> <type>bytea</type> )
+ <returnvalue>bytea</returnvalue>
+ </para>
+ <para>
+ Removes the longest string containing only bytes appearing in
+ <parameter>bytesremoved</parameter> from the start of
+ <parameter>bytes</parameter>.
+ </para>
+ <para>
+ <literal>ltrim('\x1234567890'::bytea, '\x9012'::bytea)</literal>
+ <returnvalue>\x34567890</returnvalue>
+ </para></entry>
+ </row>
+
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
<primary>octet_length</primary>
</indexterm>
<function>octet_length</function> ( <type>bytea</type> )
@@ -4196,6 +4236,26 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
</para></entry>
</row>
+ <row>
+ <entry role="func_table_entry"><para role="func_signature">
+ <indexterm>
+ <primary>rtrim</primary>
+ </indexterm>
+ <function>rtrim</function> ( <parameter>bytes</parameter> <type>bytea</type>,
+ <parameter>bytesremoved</parameter> <type>bytea</type> )
+ <returnvalue>bytea</returnvalue>
+ </para>
+ <para>
+ Removes the longest string containing only bytes appearing in
+ <parameter>bytesremoved</parameter> from the end of
+ <parameter>bytes</parameter>.
+ </para>
+ <para>
+ <literal>rtrim('\x1234567890'::bytea, '\x9012'::bytea)</literal>
+ <returnvalue>\x12345678</returnvalue>
+ </para></entry>
+ </row>
+
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
@@ -4309,26 +4369,6 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
- <primary>btrim</primary>
- </indexterm>
- <function>btrim</function> ( <parameter>bytes</parameter> <type>bytea</type>,
- <parameter>bytesremoved</parameter> <type>bytea</type> )
- <returnvalue>bytea</returnvalue>
- </para>
- <para>
- Removes the longest string containing only bytes appearing in
- <parameter>bytesremoved</parameter> from the start and end of
- <parameter>bytes</parameter>.
- </para>
- <para>
- <literal>btrim('\x1234567890'::bytea, '\x9012'::bytea)</literal>
- <returnvalue>\x345678</returnvalue>
- </para></entry>
- </row>
-
- <row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
<primary>get_bit</primary>
</indexterm>
<function>get_bit</function> ( <parameter>bytes</parameter> <type>bytea</type>,
@@ -4407,26 +4447,6 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
</row>
<row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
- <primary>ltrim</primary>
- </indexterm>
- <function>ltrim</function> ( <parameter>bytes</parameter> <type>bytea</type>,
- <parameter>bytesremoved</parameter> <type>bytea</type> )
- <returnvalue>bytea</returnvalue>
- </para>
- <para>
- Removes the longest string containing only bytes appearing in
- <parameter>bytesremoved</parameter> from the start of
- <parameter>bytes</parameter>.
- </para>
- <para>
- <literal>ltrim('\x1234567890'::bytea, '\x9012'::bytea)</literal>
- <returnvalue>\x34567890</returnvalue>
- </para></entry>
- </row>
-
- <row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>md5</primary>
@@ -4445,26 +4465,6 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
</row>
<row>
- <entry role="func_table_entry"><para role="func_signature">
- <indexterm>
- <primary>rtrim</primary>
- </indexterm>
- <function>rtrim</function> ( <parameter>bytes</parameter> <type>bytea</type>,
- <parameter>bytesremoved</parameter> <type>bytea</type> )
- <returnvalue>bytea</returnvalue>
- </para>
- <para>
- Removes the longest string containing only bytes appearing in
- <parameter>bytesremoved</parameter> from the end of
- <parameter>bytes</parameter>.
- </para>
- <para>
- <literal>rtrim('\x1234567890'::bytea, '\x9012'::bytea)</literal>
- <returnvalue>\x12345678</returnvalue>
- </para></entry>
- </row>
-
- <row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>set_bit</primary>
@@ -18354,16 +18354,14 @@ SELECT NULLIF(value, '(none)') ...
largest or smallest value from a list of any number of expressions.
The expressions must all be convertible to a common data type, which
will be the type of the result
- (see <xref linkend="typeconv-union-case"/> for details). NULL values
- in the list are ignored. The result will be NULL only if all the
- expressions evaluate to NULL.
+ (see <xref linkend="typeconv-union-case"/> for details).
</para>
<para>
- Note that <function>GREATEST</function> and <function>LEAST</function> are not in
- the SQL standard, but are a common extension. Some other databases
- make them return NULL if any argument is NULL, rather than only when
- all are NULL.
+ NULL values in the argument list are ignored. The result will be NULL
+ only if all the expressions evaluate to NULL. (This is a deviation from
+ the SQL standard. According to the standard, the return value is NULL if
+ any argument is NULL. Some other databases behave this way.)
</para>
</sect2>
</sect1>