Skip to content

Commit 8824b38

Browse files
committed
docs: specify FOR UPDATE/SHARE incompatibilities
Document that FOR UPDATE/SHARE are incompatible with GROUP BY, DISTINCT, HAVING and window functions. Michael Paquier
1 parent fc4ffba commit 8824b38

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/src/sgml/ref/select.sgml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,12 @@ GROUP BY <replaceable class="parameter">expression</replaceable> [, ...]
654654
the grouped columns (or a subset thereof) are the primary key of
655655
the table containing the ungrouped column.
656656
</para>
657+
658+
<para>
659+
Currently, <literal>FOR NO KEY UPDATE</>, <literal>FOR UPDATE</>,
660+
<literal>FOR SHARE</> and <literal>FOR KEY SHARE</> cannot be
661+
specified with <literal>GROUP BY</literal>.
662+
</para>
657663
</refsect2>
658664

659665
<refsect2 id="SQL-HAVING">
@@ -690,6 +696,12 @@ HAVING <replaceable class="parameter">condition</replaceable>
690696
within aggregate functions. Such a query will emit a single row if the
691697
<literal>HAVING</literal> condition is true, zero rows if it is not true.
692698
</para>
699+
700+
<para>
701+
Currently, <literal>FOR NO KEY UPDATE</>, <literal>FOR UPDATE</>,
702+
<literal>FOR SHARE</> and <literal>FOR KEY SHARE</> cannot be
703+
specified with <literal>HAVING</literal>.
704+
</para>
693705
</refsect2>
694706

695707
<refsect2 id="SQL-WINDOW">
@@ -824,6 +836,12 @@ UNBOUNDED FOLLOWING
824836
than one window function.
825837
</para>
826838

839+
<para>
840+
Currently, <literal>FOR NO KEY UPDATE</>, <literal>FOR UPDATE</>,
841+
<literal>FOR SHARE</> and <literal>FOR KEY SHARE</> cannot be
842+
specified with <literal>WINDOW</literal>.
843+
</para>
844+
827845
<para>
828846
Window functions are described in detail in
829847
<xref linkend="tutorial-window">,
@@ -920,6 +938,12 @@ SELECT DISTINCT ON (location) location, time, report
920938
will normally contain additional expression(s) that determine the
921939
desired precedence of rows within each <literal>DISTINCT ON</> group.
922940
</para>
941+
942+
<para>
943+
Currently, <literal>FOR NO KEY UPDATE</>, <literal>FOR UPDATE</>,
944+
<literal>FOR SHARE</> and <literal>FOR KEY SHARE</> cannot be
945+
specified with <literal>DISTINCT</literal>.
946+
</para>
923947
</refsect2>
924948

925949
<refsect2 id="SQL-UNION">

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy