Revert "Revert "replaced sqlite3 with postgresql""

This reverts commit 9c8ede5ca828923e257e3ff83e16032dd653d220.