Thank you. I found the problem. It was with the previous query, not the one that was showing up in the prompt. I found the actual query in one of the log files.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных