[erlang-questions] pgsql:prepare() doesn't work with PostgreSQL 8.3.3

Sergey S. <>
Fri Sep 5 14:30:44 CEST 2008


Hello.

As addition to the previous message on pgsql. Such code:

pgsql:pquery(Db, "INSERT INTO foo VALUES ($1)", [555])

also doesn't work, producing the error:

------------------------------------------------------------------------
** exception exit: {timeout,
                       {gen_server,call,
                           [<0.131.0>,
                            {equery,{"INSERT INTO foo VALUES ($1)",[2]}}]}}
     in function  gen_server:call/2
     in call from gin_test:storage/0
------------------------------------------------------------------------

The only way I see to do insert is:

Query = lists:flatten(io_lib:format("INSERT INTO foo VALUES (~p)", [555]))
pgsql:squery(Db, Query)

But it's not so fast...

Jungerl have the same problems, since pgsql from ejabberd-modules is a fork
of pgsql from jungerl.

psql from http://code.google.com/p/erlang-psql-driver/ seems to be
unmaitaine**d (Project status: this project was just a proof of concept and
is currently unmaintained)

Driver from Erlang Consulting is too old.

ODBC?

Which driver do you you with PostgreSQL?


Thanks.

--
Sergey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080905/376cc202/attachment.html>


More information about the erlang-questions mailing list