replace sqlite to pg