PostgreSQL with Pg DBD
From peck_d@bellsouth.net Wed Dec 19 17:23:12 2001
Hello!
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:
/usr/bin/psql
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
PostgreSQL:
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:
/usr/include/pgsql/libpq-fe.h
/usr/lib/libpq.so
Download DBD::Pg from http://www.CPAN.org .
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:
PATH=.:$PATH
export POSTGRES_INCLUDE=/usr/include/pgsql
export POSTGRES_LIB=/usr/lib
Build the module:
perl Makefile.PL
make
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.
Best
Peck
_______________________________________________
Linux-users mailing list
Archives, Digests, etc at http://linux-sxs.org/mailman/listinfo/linux-users