Connect to postgresql database