The backtraces you captured look like the query is not "hung", it's just computing away.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных