Switched to pg from sqlite3