PostgreSQL with Pg DBD
From Wed Dec 19 17:23:12 2001


Installing Postgresql with the Pg DBD module gave me a few problems, so I
thought I would share an installation method that worked for me across a
couple of distro's. Here is how I did it:

A.) Install the following RPM packages:

Development/Libraries/Perl: perl-DBI
Applications/Databases: all postgresql modules
Development Libraries: postgresql-devl

B.) Setup directories and paths for PostgreSQL:

Open a terminal and su as root
Setup disk directory for your db:

mkdir /var/lib/pgsql/data
chown postgres /var/lib/pgsql/data

Add PostgreSQL to the path by inserting the following statement:


into the PATH statement located in /etc/profile.local

C.) Initialize the PostgreSQL database, start the PostgreSQL daemon, and
test the newly installed database system:

/usr/local/pgsql/bin/initdb -D /var/lib/pgsql/data
rcpostgresql start

Quick-test the server using the boiler plate test package that ships with

su postgres
psql -d template1

Use the "\q" command to exit psql

Setup another db user:
createuser <user> (Make sure it matches an existing Linux user...)

Questions PostgreSQL asks when you run "createuser" and the answers:

Shall the new user be able to create databases? (y/n) y
Shall the new user be able to create new users? (y/n) n

Note: SuSE 7.3, SuSe 7.2 as well as RedHat Version X.anything-recent all
appear to have a Pg DBD that ship with the afore mentioned products, but I
could not get them to work.... Go figure.

So... Do this:

D.) Verify the existence of the following on your system. They are required
for the Perl-DB:


Download DBD::Pg from .

Explode and examine the downloaded components:

su as the <user> you setup for db access. Do *NOT* su as root!
Explode DBD-Pg-1.01.tar.gz into your home directory directory.
Read the README file. *Really...*

Prepare your system for the build process:

export POSTGRES_INCLUDE=/usr/include/pgsql
export POSTGRES_LIB=/usr/lib

Build the module:

perl Makefile.PL
Make sure you have no errors from the make.
make test
Make sure you only recieved "ok" statements from the make test.

install Perl-DB:

su as root
make install

YMMV, but it worked for me as described above on three different distro's.



Linux-users mailing list
Archives, Digests, etc at

searchSearch Index