get data from postgresql