"Dmitri Fuerle" <dmitri.fuerle@gmail.com> writes:
> A select on the following view hangs the database
Are you sure it's actually hung, and not (say) computing like mad?
Perhaps the planner chose a bad plan that will take a long time.
Have you ANALYZEd all the tables underlying the view?
regards, tom lane