Error out if SKIP LOCKED and WITH TIES are both specified
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 1 Oct 2021 21:29:18 +0000 (18:29 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 1 Oct 2021 21:29:18 +0000 (18:29 -0300)
commitc6bc655ee2ef09449da7ff688a8be19a13db5c4a
tree71c8f035dd23a0f3f3f53421afc7af19287cf6ea
parentd186d233dfde4afb9dff346e13c8adaf4deec6b3
Error out if SKIP LOCKED and WITH TIES are both specified

Both bugs #16676[1] and #17141[2] illustrate that the combination of
SKIP LOCKED and FETCH FIRST WITH TIES break expectations when it comes
to rows returned to other sessions accessing the same row.  Since this
situation is detectable from the syntax and hard to fix otherwise,
forbid for now, with the potential to fix in the future.

[1] https://postgr.es/m/16676-fd62c3c835880da6@postgresql.org
[2] https://postgr.es/m/17141-913d78b9675aac8e@postgresql.org

Backpatch-through: 13, where WITH TIES was introduced
Author: David Christensen <david.christensen@crunchydata.com>
Discussion: https://postgr.es/m/CAOxo6XLPccCKru3xPMaYDpa+AXyPeWFs+SskrrL+HKwDjJnLhg@mail.gmail.com
doc/src/sgml/ref/select.sgml
src/backend/commands/matview.c
src/backend/parser/gram.y
src/test/regress/expected/limit.out
src/test/regress/sql/limit.sql