Skip site navigation (1) Skip section navigation (2)

Erlang & PostgreSQL native driver

From: "Daniel Caune" <daniel(dot)caune(at)ubisoft(dot)com>
To: <erlang-questions(at)erlang(dot)org>, <pgsql-sql(at)postgresql(dot)org>
Subject: Erlang & PostgreSQL native driver
Date: 2007-11-15 19:06:28
Message-ID: 1E293D3FF63A3740B10AD5AAD88535D20675195B@UBIMAIL1.ubisoft.org (view raw or flat)
Thread:
Lists: pgsql-sql
Hi,

We are using Erlang, PostgreSQL 8.2.5, and the Erlang library pgsql
developed by Christian Sunesson
(http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/pgsql/).


The Erlang library pgsql is easy to use and does the job so far, at
least for our prototyping phase.  However, this library has a problem
with stored function that returns nothing such as:

CREATE OR REPLACE FUNCTION foo()
  RETURNS void
AS $$
  ...

The problem seems to happen when the Erlang library pgsql tries to
decode the result value return by the stored function, which is void.
The transaction has been successfully committed in database.

(u(at)pc-dcaune)3> pgsql:squery(Connection, "SELECT foo()").    
=ERROR REPORT==== 15-Nov-2007::11:40:25 ===
Error in process <0.38.0> on node 'u(at)pc-dcaune' with exit value:
{{nocatch,{unknown_oid,2278}},[{pgsql_util,decode_oid,1},{pgsql_util,dec
ode_descs,1},{pgsql_proto,process_squery,1},{pgsql_proto,idle,2}]}

** exited: {{nocatch,{unknown_oid,2278}},
            [{pgsql_util,decode_oid,1},
             {pgsql_util,decode_descs,1},
             {pgsql_proto,process_squery,1},
             {pgsql_proto,idle,2}]} **

I don't think this is a big issue.  According to the error
(unknown_oid), I suppose that the pgsql library doesn't support void
type yet.  We should be able to fix easily the library.

However, because our prototyping phase is close to the end, we are
thinking to use another library that would perhaps better fit production
constraints (pool, etc.).  We have tested the PostgreSQL ODBC driver but
we have faced some issues on Windows (Unicode, PostgreSQL data type
support).

We are interesting in having some feedback from people who use both
Erlang and PostgreSQL.  Which PostgreSQL driver do you use?  Does
someone use the PostgreSQL driver from Erlang Consulting?  Are there
other native PostgreSQL driver?

Thanks,
 
--
Daniel

pgsql-sql by date

Next:From: Jean-David BeyerDate: 2007-11-16 05:00:56
Subject: Re: Is there anything special about pg_dump's compression?
Previous:From: Stephan SzaboDate: 2007-11-15 18:36:32
Subject: Re: trap for any exception

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group