using pg instead of sqlite
Definitely changed from sqlite to postgresql