[services-ng] refine code of postgresql service

Change-Id: I88ad92f4e5ab276817e74c41875c5bb80b2e2e46