postgresql - Postgres 9.4 hangs during refreshing materialized view -


i considering problems materialized views in postgres 9.4. query "refresh materialized view xxx" hangs forever.

the way found restart postgres service. after restart execution takes seconds.

my view not complex use 10 tables.

i've executed select * pg_stat_activity state = 'active' , running query refresh view.

this problem appears centos operating system.

what should when problems comes next time? locks? or else?

in case problem in unclosed transaction.

there transaction in materialized view queried. transaction never closed.

i've added commit after query , solves issue. looks postgre hold locks on view until transaction become closed.


Comments