initial writeto postgres database