Chapter 9. Using Perl

Table of Contents
Building Perl's PostgreSQL libraries
Using the Pg module
TMTOWTDI: The DBI/DBD:Pg modules

Building Perl's PostgreSQL libraries

You want to access PostgreSQL from your Perl scripts. How do you build libraries?

Solution

You need to use the --with-perl option when running ./configure while building PostgreSQL (or check your RPMs) to get the 'Pg' module.

Alternatively, you can download and install the DBI/DBD:Pg modules from CPAN. The DBI system provides a database abstraction layer for Perl and can have multiple drivers.