Adjust sqlite to pg