Skip to content

PostgreSQL

10 messages · Tom Dye, Joe Conway, Tim Keitt +2 more

#
Tom Dye wrote:
(posting back to the list so others can join in and/or benefit)

I think it also requires this:
http://www.bioconductor.org/packages/bioc/stable/src/contrib/html/Rdbi.html

I'm afraid I don't have a Mac, and to be honest have not used RdbiPgSQL 
since before it was moved to Bioconductor. My needs for R are very 
basic, and usually I use my own connector, PL/R (see 
http://www.joeconway.com/plr/). Slightly different approach, but might 
meet your needs.

Anyway, I followed the instructions here:
http://www.bioconductor.org/docs/install-howto.html

Worked for me after I set two environment variables to point to my 
Postgres headers and libs. I did something like:


# export PG_LIB_DIR=/usr/local/pgsql-dev/lib
# export PG_INCLUDE_DIR=/usr/local/pgsql-dev/include
# R

R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.1.1  (2005-06-20), ISBN 3-900051-07-0

<snip>

[Previously saved workspace restored]

 > source("http://www.bioconductor.org/biocLite.R")
 > biocLite(c("Rdbi","RdbiPgSQL"))

I haven't really tested it, but all indications are that they both 
installed correctly.

HTH,

Joe
#
Aloha Joe,

Rdbi installs just fine.

RdbiPgSQL is available as source, and even with
export PG_LIB_DIR=/usr/local/pgsql/lib/ and
export PG_INCLUDE_DIR=/usr/local/pgsql/include/
fails to install with the following messages:

trying URL 
'http://www.bioconductor.org/src/contrib/RdbiPgSQL_1.1.4.tar.gz'
Content type 'application/x-gzip' length 28046 bytes
opened URL
==================================================
downloaded 27Kb

* Installing *source* package 'RdbiPgSQL' ...
creating cache ./config.cache

The downloaded packages are in
 	/private/tmp/RtmpzKE7wz/downloaded_packages
checking for PQconnectdb in -lpq... no

I could not find your PostgreSQL client libraries!
Use --with-pgsql-libraries=PATH; if running R's INSTALL,
use --configure-args='--with-pgsql-libraries=PATH'; or
set PG_LIB_DIR in your environment to the library path,
and rerun the configure/install.

ERROR: configuration failed for package 'RdbiPgSQL'

I'm in way over my head here and will appreciate any help.

Tom
On Mon, 5 Sep 2005, Joe Conway wrote:
Thomas S. Dye, Ph.D. 
T. S. Dye & Colleagues, Archaeologists, Inc. 
735 Bishop Street, Suite 315
Honolulu, Hawai`i 96813 
Voice (808) 387-9352 
Fax (808) 529-0884
http://www.tsdye.com
#
Tom Dye wrote:
[snip]
Is libpq.so really in /usr/local/pgsql/lib (R doesn't think so)? If not, 
find it, and point PG_LIB_DIR to that location. Unfortunately I can't 
really help you in terms of finding where the Postgres client libraries 
are located on a Mac. You may have a similar issue with PG_INCLUDE_DIR.

Joe
#
Aloha Joe,

It is really good of you to stick with this.  libpq is where it should 
be, I think:

/usr/local/pgsql/lib tomdye$ ll libpq*
-rw-r--r--  1 tomdye  tomdye  161792  3 May  2004 libpq.a
lrwxr-xr-x  1 tomdye  tomdye      12 26 Dec  2004 libpq.so@ -> 
libpq.so.3.1
lrwxr-xr-x  1 tomdye  tomdye      12 26 Dec  2004 libpq.so.3@ -> 
libpq.so.3.1
-rwxr-xr-x  1 tomdye  tomdye   90812  3 May  2004 libpq.so.3.1*

I don't know what this line of the error message means:
checking for PQconnectdb in -lpq... no

Could it be that my libpq is missing something that RdbiPgSQL needs?

Tom
On Tue, 6 Sep 2005, Joe Conway wrote:

            
Thomas S. Dye, Ph.D. 
T. S. Dye & Colleagues, Archaeologists, Inc. 
735 Bishop Street, Suite 315
Honolulu, Hawai`i 96813 
Voice (808) 387-9352 
Fax (808) 529-0884
http://www.tsdye.com
#
These are the reasons I no longer maintain the package. Everyone's setup
is completely different. I did get the postgresql folks to implement the
pg_config command to make this easier. What is the output of "pg_config
--configure"?

THK
On Tue, 2005-09-06 at 21:07 -1000, Tom Dye wrote:
#
Tim Keitt wrote:
That's a good point. Also can you show us:
pg_config --libdir
pg_config --version
Is there really an "@" on the end of "libpq.so"? Is that a Mac thing?
Well, yes, it means that RdbiPgSQL cannot find libpq in order to link to 
it. What I wonder about is whether it is really looking for libpq.so, or 
is it looking for libpq.dylib. This is another of those Mac OS X things 
I've run into before -- but I don't really understand when an so is 
required and when a dylib is required.

Joe
#
On 9/7/05 11:12 AM, "Joe Conway" <mail at joeconway.com> wrote:

            
On my mac, both .dylib and .so are in /usr/local/pgsql/lib.  And there is no
@ sign there, at least under bash.

Sean
#
Aloha all,

I can imagine it is impossible to keep up with all the different setups, 
and I appreciate all the help that I've been getting.  Here are the 
various outputs from pg_config:

pg_config --configure
'--without-readline' 'LDFLAGS=-framework CoreFoundation'

pg_config --libdir
/usr/local/pgsql/lib

pg_config --version
PostgreSQL 7.4.2

Tom
On Wed, 7 Sep 2005, Joe Conway wrote:

            
Thomas S. Dye, Ph.D. 
T. S. Dye & Colleagues, Archaeologists, Inc. 
735 Bishop Street, Suite 315
Honolulu, Hawai`i 96813 
Voice (808) 387-9352 
Fax (808) 529-0884
http://www.tsdye.com
#
On Sep 6, 2005, at 12:53 AM, Tom Dye wrote:

            
I have not installed this on my mac in a while, but my guess is that  
while these variables are set in you environment, they are not  
available in R for some reason.

You could check whether they are set in the session by looking at  
Sys.getenv()

If they are not there, I would try setting them directly in your R  
session before installing.  I think you would do that with:

Sys.setenv("PG_LIB_DIR"="/usr/local/pgsql/lib")
Sys.setenv("PG_INCLUDE_DIR"="/usr/local/pgsql/include")

But I could be off on whether the variable names need to be quoted.

Jim
#
Aloha all,

Thank you all so much for your help with installing RdbiPgSQL.  The 
problem turned out to be the one Jim McLoughlin describes below.  R wasn't 
picking up the environment variables PG_LIB_DIR and PG_INCLUDE_DIR.  I set 
these with:

Sys.putenv("PG_LIB_DIR"="/usr/local/pgsql/lib")
Sys.putenv("PG_INCLUDE_DIR"="/usr/local/pgsql/include"),

then gave R permission to run system commands as root, and the source 
install from BioConductor ran without a hitch.

I very much appreciate your time and effort.  It has been a pleasure 
interacting with you all.

Tom
On Wed, 7 Sep 2005, Jim McLoughlin wrote:

            
Thomas S. Dye, Ph.D. 
T. S. Dye & Colleagues, Archaeologists, Inc. 
735 Bishop Street, Suite 315
Honolulu, Hawai`i 96813 
Voice (808) 387-9352 
Fax (808) 529-0884
http://www.tsdye.com