You may get an error Can not Locate CPAN.pm in at INC  Linux, you need to install perl CPAN on your system.
 

# perl -MCPAN -e 'install DBD::Pg'

Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib64/perl5
/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).

 
# yum install perl-CPAN

Now, you can execute the command.