replacing sqlite w pg