Attached script (run as psql -U postgres -f bug_6350.sql) shows the problem. Enjoy!
Соглашаюсь с условиями обработки персональных данных