PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> -- SELECT THAT GIVES ERROR. RELATED TO STRING_AGG(DISTINCT (SELECT))
This is apparently a duplicate of bug #18264 ... at least,
the patch just committed for that fixes this case for me.
https://www.postgresql.org/message-id/flat/18264-e363593d7e9feb7d%40postgresql.org
regards, tom lane