Replace sqlite3 by postgres