Doing that, I can reproduce the problem, and it seems to be using an implicitly declared cursor (which I have not run into before).
pgsql-bugs by date:
Соглашаюсь с условиями обработки персональных данных