Troubleshooters.Com and T.C Linux Library Present

$POSTGRES_HOME not defined

Copyright (C) 1999 by Steve Litt, All rights reserved. Material provided as-is, use at your own risk. 


When installing DBD-Pg (the DBMS dependent section of the DBI::DBD interface between Perl and databases), upon running the perl Makefile.PL command you get the following error message:
$POSTGRES_HOME not defined
Unable to find PostgreSQL
please set environment variable POSTGRES_HOME
Note that the former is not really an error message -- the latter is. Depending on the DBD-Pg version, your subsequent make command will either say you have no target, or maybe other error messages including something to the effect of an incomplete structure.


Your PGLIB directory must have a lib directory below it. The lib directory need not contain anything. If $POSTGRES_HOME is set, it must be set to your PGLIB directory. If these conditions are not met you'll get the error condition discussed on this page. On Red Hat 6 systems, PGLIB is typically /usr/lib/pgsql.

Makefile.PL first checks to see if env var $POSTGRES_HOME is defined. If not, it loops through a series of typical postgres directories (including /usr/lib/pgsql) to see if any has a lib directory below it. The first one with a lib directory below it is assigned to $POSTGRES_HOME. Then $POSTGRES_HOME is again checked for a lib below it, and if it isn't there this message (or something like it, depending on version) is printed:

Unable to find PostgreSQL
please set environment variable POSTGRES_HOME
If your Linux installation did not put a lib directory below its PGLIB directory (/usr/lib/pgsql in Red Hat 6), you'll get this same error.


Note: before each of these steps, unset POSTGRES_HOME. Once perl Makefile.PL works correctly, you needn't take further steps.


I want to hear your results with this. Email me. Thanks

Steve Litt

Back to Troubleshooters.Com * Back to Linux Library