Greg Sabino Mullane <htamfids@gmail.com> writes:
> More detail is still needed. We don't have access to your schemas and
> functions. But at first glance, there is something else going on, not
> explained by the given code. Try to remove the unimportant parts and get it
> down to a reproducible test case.
Yes, we really need a self-contained test case.
Also, is this stock community Postgres, or some derivative
(RDS, EDB, etc)? Do you have any extensions installed?
regards, tom lane