Bayesian inference in hierarchical models by combining independent posteriors