We study the density of functions which are holomorphic in a neighbourhood of the closure \(\overline{\Omega }\) of a bounded non-smooth pseudoconvex domain \(\Omega \) , in the Bergman space \( H^2(\Omega ,\varphi )\) with a plurisubharmonic weight function \(\varphi \) . As an application, we show that the Hartogs domain \(\begin{aligned} \Omega _\alpha : = \{(z,w) \in D\times \mathbb {C}: |w|< \delta ^\alpha _D(z) \}, \ \ \ \alpha >0, \end{aligned}\) where \(D\subset \subset \mathbb {C}\) and \(\delta _D\) denotes the boundary distance to D, is Bergman complete if and only if every boundary point of D is non-isolated.