Udo Polder <udo.polder@xxxxxxxxx> writes: > I had some error today at a customer and i figured out, the problem is > triggered by postgres doing an insert on a table with wrong data (not > even provided), when it should insert the data. > After some playing around with the query, the error just went away, > magically …. Hmmm... > Postgres is: > PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, > compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit If it's really 14.1, that's quite ancient and full of known bugs. The first thing you ought to do is update to latest minor release, 14.17. I did not look at the release notes to see if any fixes overlap this area, but it'd be silly to spend a lot of time tracking down a problem only to find it's already fixed. regards, tom lane