Defects are generally regarded to have negative impact on carrier recombination, charge-transport and ion migration in perovskite materials, which thus lower the efficiency and stability of perovskite optoelectronic devices. Meanwhile, lots of efforts which focused on minimizing defects have greatly promoted the application of perovskite materials. Then, can defects be positive in perovskite optoelectronic devices? Herein, relying on in-depth understanding of defect-associated effects in semiconductors, trapping of photo-generated carriers by defects is applied to enlarge photoconductive gain in perovskite photodetector. The record photoconductive gain, gain-bandwidth product and detection limit were achieved in the photodetector. Exceeding the general concept that defects are harmful, we identify a new view that the defects can be positive in perovskite optoelectronic devices.