pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Connecting R to PostgreSQL
4+ messages / 3 participants
[nested] [flat]

* Connecting R to PostgreSQL
@ 2002-09-14 14:29  Adam Witney <awitney@sghms.ac.uk>
  0 siblings, 2 replies; 4+ messages in thread

From: Adam Witney @ 2002-09-14 14:29 UTC (permalink / raw)
  To: pgsql-interfaces


Hi,

I am not sure if the problem here relates to PostgreSQL or elsewhere, but I
am trying to connect the R statistical package to my PostgreSQL database
using the Rdbi.PgSQL driver.

The driver installs ok, however when I try to load it in R I get the
following error

> library(Rdbi.PgSQL)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
        unable to load shared library "/Users/adam/Projects/R
stuff/rlibs/Rdbi.PgSQL/libs/Rdbi.PgSQL.so":
  dlcompat: dyld: /sw/lib/R/bin/R.bin Undefined symbols:
_ERR_get_error
_ERR_reason_error_string
_SSL_CTX_new
_SSL_connect
_SSL_free
_SSL_library_init
_SSL_load_error_strings
_SSL_new
_SSL_read
_SSL_set_fd
_SSL_write
_SSLv23_method
Error in library(Rdbi.PgSQL) : .First.lib failed

Looking through the source code the driver includes <libpq-fe.h> which
subsequently includes openssl/ssl.h

I don't know if this is where the problem lies?

My system is Mac OSX 10.2

Any ideas or pointers to further information would be greatly appreciated.

Thanks

Adam


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Connecting R to PostgreSQL
@ 2002-09-14 18:30  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Adam Witney <awitney@sghms.ac.uk>
  1 sibling, 1 reply; 4+ messages in thread

From: Tom Lane @ 2002-09-14 18:30 UTC (permalink / raw)
  To: Adam Witney <awitney@sghms.ac.uk>; +Cc: pgsql-interfaces

Adam Witney <awitney@sghms.ac.uk> writes:
> The driver installs ok, however when I try to load it in R I get the
> following error

>> library(Rdbi.PgSQL)
> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>         unable to load shared library "/Users/adam/Projects/R
> stuff/rlibs/Rdbi.PgSQL/libs/Rdbi.PgSQL.so":
>   dlcompat: dyld: /sw/lib/R/bin/R.bin Undefined symbols:
> _ERR_get_error
> _ERR_reason_error_string
> _SSL_CTX_new
> _SSL_connect
> _SSL_free
> _SSL_library_init

It looks like the dynamic loader is failing to find the SSL library
(libssl.so), which is required by your PG client library.  I don't know
enough about OSX to know how library searching is handled, but on other
Unixen you'd need to mess with ldconfig or LD_LIBRARY_PATH ... or
perhaps easier, put libssl.so into a more standard location than
wherever it is now.

Alternatively, you could rebuild PG omitting SSL support.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Connecting R to PostgreSQL
@ 2002-09-14 23:36  Steven O'Toole <lists@o2l.com>
  parent: Adam Witney <awitney@sghms.ac.uk>
  1 sibling, 0 replies; 4+ messages in thread

From: Steven O'Toole @ 2002-09-14 23:36 UTC (permalink / raw)
  To: Adam Witney <awitney@sghms.ac.uk>; +Cc: pgsql-interfaces


On Saturday, September 14, 2002, at 07:29 AM, Adam Witney wrote:

>   dlcompat: dyld: /sw/lib/R/bin/R.bin Undefined symbols:
> _ERR_get_error
> _ERR_reason_error_string
> _SSL_CTX_new

I don't know if this is helpful to you since I am a novice and don't 
know R.  But I am connecting to libpq on OSX and ran into similar 
errors.  I solved them (assuming you're using ProjectBuilder in 10.2) 
in the Target/Linker Settings area.  Under the field titled Other Mach 
-O Linker Flags I entered:

	-lcrypto -lssl

I still get a warning about a duplicate definition of _crypto that I 
haven't figured out.  But the interface to PostgreSQL works great.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Connecting R to PostgreSQL
@ 2002-09-20 13:18  Adam Witney <awitney@sghms.ac.uk>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Adam Witney @ 2002-09-20 13:18 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; Adam Witney <awitney@sghms.ac.uk>; +Cc: pgsql-interfaces

On 14/9/02 7:30 pm, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

> Adam Witney <awitney@sghms.ac.uk> writes:
>> The driver installs ok, however when I try to load it in R I get the
>> following error
> 
>>> library(Rdbi.PgSQL)
>> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>>         unable to load shared library "/Users/adam/Projects/R
>> stuff/rlibs/Rdbi.PgSQL/libs/Rdbi.PgSQL.so":
>>   dlcompat: dyld: /sw/lib/R/bin/R.bin Undefined symbols:
>> _ERR_get_error
>> _ERR_reason_error_string
>> _SSL_CTX_new
>> _SSL_connect
>> _SSL_free
>> _SSL_library_init
> 
> It looks like the dynamic loader is failing to find the SSL library
> (libssl.so), which is required by your PG client library.  I don't know
> enough about OSX to know how library searching is handled, but on other
> Unixen you'd need to mess with ldconfig or LD_LIBRARY_PATH ... or
> perhaps easier, put libssl.so into a more standard location than
> wherever it is now.
> 
> Alternatively, you could rebuild PG omitting SSL support.

Hmm, I downloaded the non ssl version of postgresql from fink. Again fink
does all the compiling so I am not sure how it did it. Is there a way of
testing for sure if the ssl was or not compiled in?

Thanks

adam




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2002-09-20 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-14 14:29 Connecting R to PostgreSQL Adam Witney <awitney@sghms.ac.uk>
2002-09-14 18:30 ` Tom Lane <tgl@sss.pgh.pa.us>
2002-09-20 13:18   ` Adam Witney <awitney@sghms.ac.uk>
2002-09-14 23:36 ` Steven O'Toole <lists@o2l.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox