Changed to pg from sqlite
Changes for pg