Using the RPostgreSQL package to save the data

* way faster
errohandling

an error within the loop does not cause all the other the finish anymore.