Changed sqlite to pg