[GRASSLIST:5499] Re: problem in g.select.pg

temiz schrieb:

>>> when I try to connect postgreSQL server this message appears:
>>> /"g.select.pg: error while loading shared libraries: libpq.so: cannot
>>> open shared object file: No such file or directory."
>>>
>>> /How can I correct it ?
...
> I am using RH 8.0.
> I installed grass from binary file and postgre from Red Hat CD

Please post the output of the following command:

for i in `rpm -qa | grep -i postgres`; do echo -e "\n" $i ":"; rpm -ql
$i | grep -i libpq\.so; done

Here it is: (./psql_why a ex. file containing your comands)

postgresql-server-7.2.2-1 :
rpmq: no arguments given for query
./psql_why: line 3: postgresql-server-7.2.2-1: command not found

..

O.K., maybe i should be a bit more verbose.
I think you're missing a package in your installation, namely the package containing the file "libpq.so". To ensure my assumption i want you to check your postgres packages, whether there is a file called "libpq.so" on your system.
How to find out?
The dirty one-liner i sent you would do, but you have to write it in one line. Or like this:

#-------snip-------------------

#Get a list of installed packages
#with the word "postgres" in their name:
for i in `rpm -qa | grep -i postgres`;
#now take every package found and ...
do
  #... print the package's name:
  echo -e "\n" $i ":";
  #... and print all filenames containing the string "libpq.so"
  rpm -ql $i | grep -i libpq\.so;
done

#-------snip---------------------

On my SuSE-Linux system the result looks like this:

#-------snap---------------------

wichmann@i3:~> for i in `rpm -qa | grep -i postgres`;
> do
> echo -e "\n" $i ":";
> rpm -ql $i | grep -i libpq\.so;
> done

postgresql-libs-7.2-90 :
/usr/lib/libpq.so.2
/usr/lib/libpq.so.2.0
/usr/lib/libpq.so.2.2

postgresql-perl-7.2-90 :

postgresql-tcl-7.2-90 :

postgresql-server-7.2-90 :

postgresql-7.2-90 :

postgresql-tk-7.2-90 :

postgresql-devel-7.2-90 :
/usr/lib/libpq.so

#-------snap-----------------------

As you can see, there are two packages named "postgresql-libs" and "postgresql-devel" containing (different versions) of the file you are missing. I don't know how they are called on your redhat system, but i guess their names are similar. You have to find these on your redhat cd's and install them.
Alternatively you can try and remove your grass installation and install the grass rpm packages provided by the intevation guys:

http://ftp.gwdg.de/pub/misc/freegis/intevation/freegis/gnu-linux-i586/updates/

Ingo

I managed to get Postrges/GRASS interface to work by copying the libpq.so.2 and changing its name to libpq.so. Is this fine or should I correct the mistake I made as you said. I run RedHat 7.3 with GRASS 5.0.0 and PostgreSQL 7.2.
Is this the reason I can not install the R/PostgreSQL interface?

Thanks, Miha Staut

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail

Miha STAUT schrieb:

I managed to get Postrges/GRASS interface to work by copying the libpq.so.2 and changing its name to libpq.so. Is this fine or should I correct the mistake I made as you said. I run RedHat 7.3 with GRASS 5.0.0 and PostgreSQL 7.2.
Is this the reason I can not install the R/PostgreSQL interface?

I've never used R.

Ingo

On Sat, Feb 08, 2003 at 10:59:37AM +0100, Ingo Wichmann wrote:

Miha STAUT schrieb:
> I managed to get Postrges/GRASS interface to work by copying the
> libpq.so.2 and changing its name to libpq.so. Is this fine or should I
> correct the mistake I made as you said. I run RedHat 7.3 with GRASS
> 5.0.0 and PostgreSQL 7.2.
> Is this the reason I can not install the R/PostgreSQL interface?

The latter question is probably related to another mailing list,
but here some hints:
http://grass.itc.it/statsgrass/learning_r1.html#Connecting_R_to_RDBMS

... which I have added recently. The installation of R/PostgreSQL interface
has changed recently and is not well documented on the R web sites.
Above solution works well (for me).

Markus Neteler