Re: BUG #19827: postgres_fdw: Assert in add_foreign_ordered_paths() with redundant ORDER BY in set-op input

Started by Robins Tharakanabout 3 hours ago1 messagesbugs
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t254528
psql -h localhost -U postgres

Built from patchset v1 (message #1), November 02, 2026 at 04:23 PM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t254528_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t254528_1 && git checkout t254528_1

Patchset v1 (message #1) is on t254528_1

Jump to latest
#1Robins Tharakan
tharakan@gmail.com

Hi,

It fails on master and REL_17_STABLE to REL_19_STABLE; 16 has no
setop_pathkeys. On 17 only UNION inputs trip it; from 18 EXCEPT does
too (and INTERSECT, tried on master). A patch follows in a reply.

The patch (in a reply to this report), is against master 6cda9dfc4f97,
and applies through to REL_17_STABLE. In add_foreign_ordered_paths(),
the base/join branch now handles the set-operation case first:

Here's the patch that fixes the issue.
It applies from HEAD through REL_17_STABLE. make check passes too.

-
robins | robins.in

Attachments:

t254528_1
repro.sqlapplication/octet-stream; name=repro.sqlDownload
v1-0001-postgres_fdw-Fix-assertion-with-redundant-ORDER-BY-in-set-op-input.patchapplication/octet-stream; name=v1-0001-postgres_fdw-Fix-assertion-with-redundant-ORDER-BY-in-set-op-input.patchDownload+62-1