preparing postgresql database