changed sqlite to pg