agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Use default limitOption in subquery generated for MIN/MAX index
7+ messages / 1 participants
[nested] [flat]

* pgsql: Use default limitOption in subquery generated for MIN/MAX index
@ 2026-09-18 15:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2026-09-18 15:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use default limitOption in subquery generated for MIN/MAX index scan.

We unintentionally copied the original query's limitOption field while
building the modified subquery.  If it was LIMIT_OPTION_WITH_TIES,
that behavior would propagate through to execution, potentially
causing a "more than one row returned by a subquery used as an
expression" error.  Fix by resetting to the default LIMIT_OPTION_COUNT.
This bug dates back to the introduction of WITH TIES.

Bug: #19694
Reported-by: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Author: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19694-4e61bd0475398eef@postgresql.org
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/32872d0c9790e570105f55682e92fba22ae1b38d

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 1 +
1 file changed, 1 insertion(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Use default limitOption in subquery generated for MIN/MAX index
@ 2026-09-18 15:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2026-09-18 15:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use default limitOption in subquery generated for MIN/MAX index scan.

We unintentionally copied the original query's limitOption field while
building the modified subquery.  If it was LIMIT_OPTION_WITH_TIES,
that behavior would propagate through to execution, potentially
causing a "more than one row returned by a subquery used as an
expression" error.  Fix by resetting to the default LIMIT_OPTION_COUNT.
This bug dates back to the introduction of WITH TIES.

Bug: #19694
Reported-by: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Author: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19694-4e61bd0475398eef@postgresql.org
Backpatch-through: 14

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0d5505a22c4ce25e62166e4b5d68b07c27a42408

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 1 +
1 file changed, 1 insertion(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Use default limitOption in subquery generated for MIN/MAX index
@ 2026-09-18 15:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2026-09-18 15:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use default limitOption in subquery generated for MIN/MAX index scan.

We unintentionally copied the original query's limitOption field while
building the modified subquery.  If it was LIMIT_OPTION_WITH_TIES,
that behavior would propagate through to execution, potentially
causing a "more than one row returned by a subquery used as an
expression" error.  Fix by resetting to the default LIMIT_OPTION_COUNT.
This bug dates back to the introduction of WITH TIES.

Bug: #19694
Reported-by: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Author: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19694-4e61bd0475398eef@postgresql.org
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/720d3df25f4926849dadee19269d7c8efd6f1cf8

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 1 +
1 file changed, 1 insertion(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Use default limitOption in subquery generated for MIN/MAX index
@ 2026-09-18 15:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2026-09-18 15:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use default limitOption in subquery generated for MIN/MAX index scan.

We unintentionally copied the original query's limitOption field while
building the modified subquery.  If it was LIMIT_OPTION_WITH_TIES,
that behavior would propagate through to execution, potentially
causing a "more than one row returned by a subquery used as an
expression" error.  Fix by resetting to the default LIMIT_OPTION_COUNT.
This bug dates back to the introduction of WITH TIES.

Bug: #19694
Reported-by: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Author: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19694-4e61bd0475398eef@postgresql.org
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/70d0ac3c91f16ea29722dc6e5cee1d5a9f88533a

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 1 +
1 file changed, 1 insertion(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Use default limitOption in subquery generated for MIN/MAX index
@ 2026-09-18 15:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2026-09-18 15:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use default limitOption in subquery generated for MIN/MAX index scan.

We unintentionally copied the original query's limitOption field while
building the modified subquery.  If it was LIMIT_OPTION_WITH_TIES,
that behavior would propagate through to execution, potentially
causing a "more than one row returned by a subquery used as an
expression" error.  Fix by resetting to the default LIMIT_OPTION_COUNT.
This bug dates back to the introduction of WITH TIES.

Bug: #19694
Reported-by: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Author: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19694-4e61bd0475398eef@postgresql.org
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a91d664d51c0e702bd878a40457fc8440ebfd0b9

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 1 +
1 file changed, 1 insertion(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Use default limitOption in subquery generated for MIN/MAX index
@ 2026-09-18 15:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2026-09-18 15:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use default limitOption in subquery generated for MIN/MAX index scan.

We unintentionally copied the original query's limitOption field while
building the modified subquery.  If it was LIMIT_OPTION_WITH_TIES,
that behavior would propagate through to execution, potentially
causing a "more than one row returned by a subquery used as an
expression" error.  Fix by resetting to the default LIMIT_OPTION_COUNT.
This bug dates back to the introduction of WITH TIES.

Bug: #19694
Reported-by: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Author: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19694-4e61bd0475398eef@postgresql.org
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/47c43ffdae795e382903c63fd2169daa6b13be30

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 1 +
1 file changed, 1 insertion(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Use default limitOption in subquery generated for MIN/MAX index
@ 2026-09-18 15:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2026-09-18 15:02 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use default limitOption in subquery generated for MIN/MAX index scan.

We unintentionally copied the original query's limitOption field while
building the modified subquery.  If it was LIMIT_OPTION_WITH_TIES,
that behavior would propagate through to execution, potentially
causing a "more than one row returned by a subquery used as an
expression" error.  Fix by resetting to the default LIMIT_OPTION_COUNT.
This bug dates back to the introduction of WITH TIES.

Bug: #19694
Reported-by: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Author: Chaitanya Choudhary <chaitanyyachoudhary@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19694-4e61bd0475398eef@postgresql.org
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d98b99b2ab022dd499d26917fb1dd03fec257267

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 1 +
1 file changed, 1 insertion(+)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2026-09-18 15:02 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-18 15:02 pgsql: Use default limitOption in subquery generated for MIN/MAX index Tom Lane <tgl@sss.pgh.pa.us>
2026-09-18 15:02 pgsql: Use default limitOption in subquery generated for MIN/MAX index Tom Lane <tgl@sss.pgh.pa.us>
2026-09-18 15:02 pgsql: Use default limitOption in subquery generated for MIN/MAX index Tom Lane <tgl@sss.pgh.pa.us>
2026-09-18 15:02 pgsql: Use default limitOption in subquery generated for MIN/MAX index Tom Lane <tgl@sss.pgh.pa.us>
2026-09-18 15:02 pgsql: Use default limitOption in subquery generated for MIN/MAX index Tom Lane <tgl@sss.pgh.pa.us>
2026-09-18 15:02 pgsql: Use default limitOption in subquery generated for MIN/MAX index Tom Lane <tgl@sss.pgh.pa.us>
2026-09-18 15:02 pgsql: Use default limitOption in subquery generated for MIN/MAX index Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox