prepare to write record to postgresql DB