Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-18 Thread Michael Snoyman
On Tue, Jan 18, 2011 at 1:17 PM, John Lato wrote: >> From: Michael Snoyman >> >> > I took a quick look at the enumerators library, but it doesn't seem to >> > have >> > the necessary support for handling data that comes from arbitrary C API >> > function calls rather than handles or sockets. >> >

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-18 Thread John Lato
> > From: Michael Snoyman > > > I took a quick look at the enumerators library, but it doesn't seem to > have > > the necessary support for handling data that comes from arbitrary C API > > function calls rather than handles or sockets. > > It does support this, for prior art see yaml[1] or yajl-e

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread Michael Snoyman
On Mon, Jan 17, 2011 at 11:38 PM, John Goerzen wrote: > On 01/17/2011 03:16 PM, Michael Snoyman wrote: >> >> I've brought up before my problem with the convertible package: it >> encourages usage of partial functions. I would prefer two typeclasses, >> one for guaranteed conversions and one for co

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread John Goerzen
On 01/17/2011 03:16 PM, Michael Snoyman wrote: I've brought up before my problem with the convertible package: it encourages usage of partial functions. I would prefer two typeclasses, one for guaranteed conversions and one for conversions which may fail. In fact, that is precisely why convertibl

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread Michael Snoyman
On Mon, Jan 17, 2011 at 10:52 PM, John Goerzen wrote: > On 01/17/2011 10:07 AM, Michael Snoyman wrote: >> >> On Mon, Jan 17, 2011 at 4:49 PM, Leon Smith >>  wrote: >>> >>> On Sat, Jan 8, 2011 at 11:55 AM, Michael Snoyman >>>  wrote: >>> In general I think it would be a good thing to have soli

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread John Goerzen
On 01/17/2011 10:07 AM, Michael Snoyman wrote: On Mon, Jan 17, 2011 at 4:49 PM, Leon Smith wrote: On Sat, Jan 8, 2011 at 11:55 AM, Michael Snoyman wrote: In general I think it would be a good thing to have solid, low-level bindings to PostgreSQL. Well, there is PostgreSQL and libpq on hac

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread Michael Snoyman
On Mon, Jan 17, 2011 at 4:49 PM, Leon Smith wrote: > On Sat, Jan 8, 2011 at 11:55 AM, Michael Snoyman wrote: > >> In general I think it would be a good thing to have solid, low-level >> bindings to PostgreSQL. > > Well, there is PostgreSQL and libpq on hackage: > > http://hackage.haskell.org/pac

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-17 Thread Leon Smith
On Sat, Jan 8, 2011 at 11:55 AM, Michael Snoyman wrote: > In general I think it would be a good thing to have solid, low-level bindings > to PostgreSQL. Well, there is PostgreSQL and libpq on hackage: http://hackage.haskell.org/package/libpq http://hackage.haskell.org/package/PostgreSQL The P

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-08 Thread Michael Snoyman
On Fri, Jan 7, 2011 at 6:01 PM, John Goerzen wrote: > On 01/07/2011 09:49 AM, John Goerzen wrote: >> >> On 01/07/2011 05:24 AM, Michael Snoyman wrote: >>> >>> On Fri, Jan 7, 2011 at 11:44 AM, Iustin Pop wrote: >>> Yes, I had a bug reported in persistent-postgresql that I traced back >>> to this bu

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread John Goerzen
On 01/07/2011 09:49 AM, John Goerzen wrote: On 01/07/2011 05:24 AM, Michael Snoyman wrote: On Fri, Jan 7, 2011 at 11:44 AM, Iustin Pop wrote: Yes, I had a bug reported in persistent-postgresql that I traced back to this bug. I reported the bug, but never heard a response. Frankly, if I had time,

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread Iustin Pop
On Fri, Jan 07, 2011 at 09:49:35AM -0600, John Goerzen wrote: > On 01/07/2011 05:24 AM, Michael Snoyman wrote: > >On Fri, Jan 7, 2011 at 11:44 AM, Iustin Pop wrote: > >Yes, I had a bug reported in persistent-postgresql that I traced back > >to this bug. I reported the bug, but never heard a respon

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread John Goerzen
On 01/07/2011 05:24 AM, Michael Snoyman wrote: On Fri, Jan 7, 2011 at 11:44 AM, Iustin Pop wrote: Yes, I had a bug reported in persistent-postgresql that I traced back to this bug. I reported the bug, but never heard a response. Frankly, if I had time, I would write a low-level PostgreSQL bindin

Re: [Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread Michael Snoyman
On Fri, Jan 7, 2011 at 11:44 AM, Iustin Pop wrote: > Hi all, > > It seems that (at least) the postgresql bindings do not allow pure > binary data. > > I have a simple table: > >  debug=# create table test (name bytea); > > byteas seems to be the backing type on the DB side for bytestrings. > > and

[Haskell-cafe] HDBC, postgresql, bytestrings and embedded NULLs

2011-01-07 Thread Iustin Pop
Hi all, It seems that (at least) the postgresql bindings do not allow pure binary data. I have a simple table: debug=# create table test (name bytea); byteas seems to be the backing type on the DB side for bytestrings. and then I run this: import Database.HDBC.PostgreSQL import Database

Re: [Haskell-cafe] HDBC-postgresql and safe/unsafe FFI calls

2010-09-02 Thread Leon Smith
On Thu, Sep 2, 2010 at 1:00 AM, David Powell wrote: > Thanks Jason, I think I had read that - I quite enjoy Edward's posts. > Re-reading, seems to confirm what I thought, most (all?) of the FFI calls in > HDBC-postgresql should be changed to "safe". Wouldn't that require thread safety on the part

Re: [Haskell-cafe] HDBC-postgresql and safe/unsafe FFI calls

2010-09-01 Thread Jason Dagit
On Wed, Sep 1, 2010 at 10:00 PM, David Powell wrote: > > Thanks Jason, I think I had read that - I quite enjoy Edward's posts. > Re-reading, seems to confirm what I thought, most (all?) of the FFI calls in > HDBC-postgresql should be changed to "safe". Yes I think so. Unless you know the call is

Re: [Haskell-cafe] HDBC-postgresql and safe/unsafe FFI calls

2010-09-01 Thread David Powell
Thanks Jason, I think I had read that - I quite enjoy Edward's posts. Re-reading, seems to confirm what I thought, most (all?) of the FFI calls in HDBC-postgresql should be changed to "safe". -- David On Thu, Sep 2, 2010 at 2:47 PM, Jason Dagit wrote: > On Wed, Sep 1, 2010 at 7:40 PM, David Pow

Re: [Haskell-cafe] HDBC-postgresql and safe/unsafe FFI calls

2010-09-01 Thread Jason Dagit
On Wed, Sep 1, 2010 at 7:40 PM, David Powell wrote: > Greetings, > > I'm having an issue with the HDBC-postgresql package that requires me to > manually patch it before installation for most of my use cases. > > All the FFI calls in this package are marked "unsafe".  Unfortunately, this > means th

[Haskell-cafe] HDBC-postgresql and safe/unsafe FFI calls

2010-09-01 Thread David Powell
Greetings, I'm having an issue with the HDBC-postgresql package that requires me to manually patch it before installation for most of my use cases. All the FFI calls in this package are marked "unsafe". Unfortunately, this means that whenever I issue a slow sql query, all other processing stops.

Re: [Haskell-cafe] HDBC PostgreSQL

2009-10-10 Thread Patrick Brannan
That did the trick. Everything works perfectly now. Thank you. On Sat, Oct 10, 2009 at 8:04 AM, Duncan Coutts wrote: > On Fri, 2009-10-09 at 14:56 -0500, Patrick Brannan wrote: >> Hello, >> >> I'm getting back into Haskell after an absence of a few years. I'm in >> the process of trying to connec

Re: [Haskell-cafe] HDBC PostgreSQL

2009-10-10 Thread Duncan Coutts
On Fri, 2009-10-09 at 14:56 -0500, Patrick Brannan wrote: > Hello, > > I'm getting back into Haskell after an absence of a few years. I'm in > the process of trying to connect to postgresql with hdbc-postgresql on > a Windows XP box. > > Seemingly, things installed without a problem, but at the

Re: [Haskell-cafe] HDBC PostgreSQL

2009-10-10 Thread Ketil Malde
Patrick Brannan writes: > Prelude> :module Database.HDBC Database.HDBC.PostgreSQL > module `Database.HDBC.PostgreSQL' is not loaded I wonder if I haven't seen this when I'm in the package's top directory, that is, the current directory contains Database/HDBC/PostgreSQL.hs below it. Cd somewhere

Re: [Haskell-cafe] HDBC PostgreSQL

2009-10-09 Thread Patrick Brannan
No, I was running the following: :module Database.HDBC Database.HDBC.PostgreSQL and the reply was: module `Database.HDBC.PostgreSQL' is not loaded Not sure where to go from here. I'll keep reading. On Fri, Oct 9, 2009 at 4:58 PM, John Goerzen wrote: > Patrick Brannan wrote: >> Prelude> module H

Re: [Haskell-cafe] HDBC PostgreSQL

2009-10-09 Thread John Goerzen
Patrick Brannan wrote: > Prelude> module HDBC HDBC.PostgreSQL > > Now I would think that the line "Loading package > HDBC-postgresql-2.1.0.0 ... linking ... done." means that the module > is installed correctly, but I still can't execute the :module > statement. > > Does anyone have any ideas abo

[Haskell-cafe] HDBC PostgreSQL

2009-10-09 Thread Patrick Brannan
Hello, I'm getting back into Haskell after an absence of a few years. I'm in the process of trying to connect to postgresql with hdbc-postgresql on a Windows XP box. Seemingly, things installed without a problem, but at the command prompt I get the following: Prelude> :module Database.HDBC Data