Magnus Hagander <magnus@hagander.net> writes:
> Simon Riggs wrote:
>> Could we report both?
> Yes, we could easily do that if we want to.
It would be entirely silly to do so, since (a) the old value hasn't been
changed if we fail here, and (b) it's irrelevant to the nature of the
error.
What's also a bit silly is using PANIC for this report --- AFAICS plain
old ERROR is sufficient, since if we fail here we have not yet modified
any persistent state. Just because it's a "can't happen" condition
doesn't justify making it a PANIC.
regards, tom lane