Discussion:
guile-dbi and PostgreSQL
(too old to reply)
Christopher Baines
2017-07-21 07:34:23 UTC
Permalink
Hey,

I've been having a try getting guile-dbi talking to PostgreSQL. I'm
using Guix packages, adapted to use the sources from [1].

1: https://github.com/opencog/guile-dbi/releases

So far, I'm getting an error about a undefined symbol.

scheme@(guile-user)> (define db-obj (dbi-open "postgresql" "postgres"))
scheme@(guile-user)> (dbi-query "\\d")
scheme@(guile-user)> (dbi-query db-obj "\\d")
scheme@(guile-user)> (display db-obj) (newline)
#<guile-dbi close postgresql postgres
(1 . /gnu/store/w5g1gpxbqfpkv0qnryglh6m7g9hd90an-guile-dbi-2.1.6/lib/libguile-dbi.so.2:
undefined symbol: __postgresql_query_g_db_handle)>

Any ideas?

Thanks,

Chris
Nala Ginrut
2017-07-21 09:44:15 UTC
Permalink
Have you installed guile-dbd-postgresql?
Post by Christopher Baines
Hey,
I've been having a try getting guile-dbi talking to PostgreSQL. I'm
using Guix packages, adapted to use the sources from [1].
1: https://github.com/opencog/guile-dbi/releases
So far, I'm getting an error about a undefined symbol.
#<guile-dbi close postgresql postgres
undefined symbol: __postgresql_query_g_db_handle)>
Any ideas?
Thanks,
Chris
Christopher Baines
2017-07-21 18:05:04 UTC
Permalink
On Fri, 21 Jul 2017 17:44:15 +0800
Post by Nala Ginrut
Have you installed guile-dbd-postgresql?
I'm not quite sure what installed would mean in this case? I've copied
the guix guile-dbd-sqlite3 package, and adjusted it to be
guile-dbd-postgresql.

I'm then testing using:

guix environment --ad-hoc guile guile-dbi guile-dbd-postgresql

From looking at the code, I was guessing I'd get a different error if
the library wasn't found, as I though this [1] check might fail, but
I'm struggling to read the guile-dbi code, as I'm not familiar at all
with using Guile within C.

1:
https://github.com/opencog/guile-dbi/blob/master/guile-dbi/src/guile-dbi.c#L75
Nala Ginrut
2017-07-22 04:32:23 UTC
Permalink
Why you modify dbd-sqlite3 for that? There's dbd-postgresql

2017年7月22日 02:05,"Christopher Baines" <***@cbaines.net>写道:

On Fri, 21 Jul 2017 17:44:15 +0800
Post by Nala Ginrut
Have you installed guile-dbd-postgresql?
I'm not quite sure what installed would mean in this case? I've copied
the guix guile-dbd-sqlite3 package, and adjusted it to be
guile-dbd-postgresql.

I'm then testing using:

guix environment --ad-hoc guile guile-dbi guile-dbd-postgresql

From looking at the code, I was guessing I'd get a different error if
the library wasn't found, as I though this [1] check might fail, but
I'm struggling to read the guile-dbi code, as I'm not familiar at all
with using Guile within C.

1:
https://github.com/opencog/guile-dbi/blob/master/guile-
dbi/src/guile-dbi.c#L75
Christopher Baines
2017-07-22 07:52:11 UTC
Permalink
On Sat, 22 Jul 2017 12:32:23 +0800
Post by Nala Ginrut
Why you modify dbd-sqlite3 for that? There's dbd-postgresql
As far as I can see, I don't have a Guix package for dbd-postgresql. I
didn't mean modify dbd-sqlite3 in terms of code, just the Guix package
definition.

Loading...