Oscar van Baten <info@oxcro.com> writes:
> There you go:
> GroupAggregate (cost=94.38..128.98 rows=200 width=96)
> Output: a.id, string_agg(DISTINCT 'val_B'::text, ', '::text),
> (json_agg(json_build_object('val_1', a.id, 'val_2', (SubPlan 1))))::text|
Ah, that gave me the clue I needed (maybe I should have deduced it
from your Subject, but I plead ENOCAFFEINE). Your query as submitted
doesn't use DISTINCT in the STRING_AGG call, but that's needed to
trigger the bug. And it is indeed the same bug as #18264: it begins
at the same commit, and David's WIP patch fixes it.
regards, tom lane