If you'll forgive a random question from an onlooker: Why did the functions return True if the process is still
ongoing?
https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL
"Each of these functions returns true if successful and false otherwise."
Is the definition of successful "the signal was sent" and not "the signal was actually received and did something"?
> But __read_nocancel suggests the process might be stuck in an I/O
> request, likely a network call to the Oracle. So maybe it's waiting for
> data from oracle_fdw, which means it can't cancel the query.
> postgres=# SELECT pg_cancel_backend(16647);
> pg_cancel_backend
> -------------------
> t
> (1 row)
>
> postgres=# SELECT pg_terminate_backend(16647);
> pg_terminate_backend
> ----------------------
> t
> (1 row)
>
> postgres=# select pid,application_name FROM pg_stat_activity where
> application_name IS NOT NULL AND state = 'active';
> pid | application_name
> -------+------------------------
> 16647 | PostgreSQL JDBC Driver
> 19879 | psql