PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> PoC:
> select
> ...
> where pg_catalog.pg_terminate_backend(
> cast(pg_catalog.pg_backend_pid() as int4),
You told the session to terminate itself, and it did. I see
no bug here.
regards, tom lane