Re: PostgreSQL/Perl
by ColtsFoot (Chaplain) on Nov 02, 2001 at 20:57 UTC
|
You need to set the two environment variables to point at
the postgres lib and include directory
POSTGRES_INCLUDE=/usr/include/pgsql
POSTGRESQL_LIB=/usr/lib
export POSTGRES_INCLUDE POSTGRES_LIB
or
setenv POSTGRES_INCLUDE /usr/include/pgsql
setenv POSTGRESQL_LIB /usr/lib
depending on your shell
The location of these directories will vary depending on how
you installed postgresql
Hope this helps
| [reply] [d/l] |
|
In my case it looks like:
export POSTGRES_HOME=/usr/local/pgsql
export PGLIB=$POSTGRES_HOME/lib
export PGDATA=$POSTGRES_HOME/data
export LD_LIBRARY_PATH=$PGLIB
export PATH=/usr/bin:/usr/local/pgsql/bin:$PATH
inside .bashrc.
Hanamaki | [reply] [d/l] |
|
Can do those commands from anywhere or do they have to be done from inside the directories?
| [reply] |
|
Usually you put these commands into .bashrc,
.bash_profile or wherever your systems looks for Environmental
variables. Of course you can type these command all the
time you reboot your system, but that doesn't seem very
comfortable.
Hanamaki
| [reply] |
|
|
Re: PostgreSQL/Perl
by Purdy (Hermit) on Nov 02, 2001 at 23:54 UTC
|
Just a small follow-up: The reason the rest of your installation steps did not work is because the 'perl Makefile.PL' didn't generate a Makefile. You will know it has been successful when it says something to the affect of "Creating Makefile" near the end. If you type 'make' and nothing happens, then you need to fix the previous issue before moving on (which the prior responses address :)). I had the same thing when I first tackled DBD-Pg.
Have fun!
Jason | [reply] |
Re: PostgreSQL/Perl
by Anonymous Monk on Nov 03, 2001 at 08:13 UTC
|
Hello,
I managed to get the perl Makefile.PL to work.
I tried make test but got an error stating that
libpg-fe.h could not be found.
I did a search for it and found it in
/usr/include/pgsql/lib
This is what my .bashrc looks like now.
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
export POSTGRES_HOME=/var/lib/pgsql
export PGLIB=/usr/include/pgsql/lib
export PGDATA=$POSTGRES_HOME/data
export LD_LIBRARY_PATH=$PGLIB
export PATH=/usr/bin:/var/lib/pgsql/bin:$PATH
# Source global definitions
if -f /etc/bashrc ; then
. /etc/bashrc
fi
Am I doing something wrong?
D.
| [reply] |
|
Hello,
I've changed the .bashrc file because my lib
path was wrong.
make still can't find libpq-fe.h even though it
is in /usr/include/pgsql
New entry in to .bashrc
export POSTGRES_HOME=/var/lib/pgsql
export PGLIB=/usr/include/pgsql
export PGDATA=$POSTGRES_HOME/data
export LD_LIBRARY_PATH=$PGLIB
export PATH=/usr/bin:/var/lib/pgsql/data:
/var/lib/pgsql/data: /usr/include/pgsql:/bin:$PATH
When I type env all the variables have the correct path
names. As well, I don't seem to have a pgsql/bin directory anywhere
Is this odd?
Getting kind of confused here! Any help would be muchly
appreciated.
D.
| [reply] |
|
Search for binaries like createdb,
createuser, psql, etc. pp. If you
cannot find them the chances that Postgresql is not
installed are pretty high.
If you got stuck just try to compile Postgres
again, start postgres with the postmaster command,
test wether Postgres is working by using
psql from the shell; install "DBI" and "DBD::Pg" and become
a member of Perlmonks. Once I tried RPM's but it didn't
work out for me. Therfore I cannot say much about a RPM install.
Hanamaki
| [reply] [d/l] [select] |
|
Did you do a make after perl Makefile.PL?
Missing libraries are usually stated during the make process,
but not while doing make test.
Hanamaki
| [reply] [d/l] [select] |
|
You can use the force command to ignore errors and install anyway. I had to do this once for PostGreSQL as well.
However your linux distribution should have DBD::Pg as a rpm. Use your favourite rpm front end and search for 'Pg' and then install the right rpm. No compiling necessary. ____________________
Jeremy
I didn't believe in evil until I dated it.
| [reply] |
Re: PostgreSQL/Perl
by dustbuster (Novice) on Nov 04, 2001 at 02:26 UTC
|
I know that postgres is installed...been using postmaster
to start it.
I'm a new use to Linux. How do I use force to force
the install. I have installed RPMs so I'll give that
a try.
BTW: Hanamaki, I was waiting for my password to be mailed.
Hotmail can act weird sometimes.
D. | [reply] |
(ichimunki) Re: PostgreSQL/Perl
by ichimunki (Priest) on Nov 09, 2001 at 04:53 UTC
|
OK. So you've gotten quite a few answers on this, but I want to iterate what I've done to compile this module. I prefer not to set these environment variables in my .*rc or .*_profile files for the simple fact that once I'm done with this compile I won't be using them again.
With RH7.0 I assume you're using BASH, so you'd simply do the following at the command prompt:
export POSTGRES_LIB="/usr/local/pgsql/lib/"
export POSTGRES_INCLUDE="/usr/local/pgsql/include/"
or whatever the correct path is. If you installed the RPM for pgsql-dev, then they might just be in /usr/lib and /usr/include somewhere.
If you really feel the need to include these in your .*rc or .*_profile files, you don't need to log out to activate the changes. Just execute the files. They're shell scripts, and the express purpose of a shell script is to be executed from a shell. Use either sh .bashrc or ./.bashrc depending on whether your .bashrc is set to be executable or (probably) not.
It doesn't matter what user you are when you run configure, make and test as long as you have write permissions to the folder the module source is in, but you need to be root to install the module in a system-wide-available fashion (recommended).
| [reply] [d/l] [select] |
Re: PostgreSQL/Perl
by Zecho (Hermit) on Nov 09, 2001 at 04:39 UTC
|
First, a few comments on this thread. Anytime you change your .bashrc file you should log out and back in again. Check the Makefile.pl for any variables that may need to be set. Although not recommended (I'm sure I'll get flamed for suggesting it) Sometimes, you just have to skip the make test and go straight to make install. Just dont do this if one of the steps you take prior fails. in fact, to clarify, If any of your installation steps fail, do not proceed to the next step. Do a make clean and start over once you figure out what caused the failure.On your newest thread on this subject, I don't recommend installing modules via rpm, but if you insist, you can generally find anything you need at http://rpmfind.net
| [reply] [d/l] [select] |
Re: PostgreSQL/Perl
by ralphie (Friar) on Nov 09, 2001 at 05:02 UTC
|
one thing you might think about is removing the binary installation of postgresql that must have been installed with your distribution and grabbing the new gzipped tarball from <a href=http://www.postgresql.org </href>here. it's about an 8mb download, so it's not too onerous. when you install you can specify the location of those files in the configure process, but by default it'll put the tree in /usr/local/pgsql. installing that way you'll know that all the files are there. i don't know that you have to get all wound up in changing your initialization files, the only time you need the environment variables is during the build process. the last couple of times i've done this i invoked csh, issued
setenv POSTGRES_LIB '/usr/local/pgsql/lib' and
setenv POSTGRES_INCLUDE '/usr/local/pgsql/include'
and exited back to bash. everthing built smoothly (on debian). for some reason this just seemed to go more smoothly in the c shell. | [reply] |
Re: PostgreSQL/Perl
by ralphie (Friar) on Jul 22, 2002 at 14:52 UTC
|
Posting to this old thread just to get this in the aggregate knowledge base, i've not seen it explicitly mentioned in the monastery. When compiling the postgresql dbd driver you need to be able to reference the lib and include directories of a built postgresql system. i think the directories could be on a remote system accessed through a nfs or smbfs mount point, but would generally be on the host machine. note that the postgresql installation need not be active and that the libraries with which the client is compiled can be removed as soon as it is compiled. to restate, when the libpg-fe.h error is received the postgresql source will have to be built, installed, and the location of the lib and include directories referenced in the POSTGRES_LIB and POSTGRES_INCLUDE environment variables. | [reply] |