To close the loop on this.
That bug was indeed at the heart of the issue. We tested the app and query running Postgres 12.4 and the problem did not occur.
Thanks to all who responded.
> On Oct 29, 2020, at 2:02 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> ... BTW, if this is EDB's build rather than something you built
> yourself, it might be the issue described here:
>
> https://www.postgresql.org/message-id/flat/CAM9w-_%3DnArgTfn6jSgVCEkUo%3DzoMzGVvZHQRmox74c93vY3QMA%40mail.gmail.com
>
> regards, tom lane