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

Sergey S. neavirc@REDACTED
Fri Sep 5 12:30:03 CEST 2008


Does anybody use pgsql:prepare() function from pgsql driver with latest
PostgreSQL 8.3.3?

I tried with both of jungerl and ejabberd-modules versions and have the
following issue:

I have the following simple table:

CREATE TABLE foo (
    bar    int
);
And this code:

% -------------------------------------------------

test_pgsql() ->
    {ok, Db} = pgsql:connect("localhost", "test", "test", ""),

    pgsql:prepare(Db, add_example, "INSERT INTO foo (bar) VALUES
($1::int4)"), % <- CRASH occured at this call!
    pgsql:execute(Db, add_example, [1, 2]),

    pgsql:terminate(Db).

% -------------------------------------------------

When pgsql:prepare() is called I get (in ejabberd-modules edition) the
following error message: http://pastebin.com/f1b777cd

I tried to ommit "::int4" suffix - this didn't help.

squery() and pquery() work fine.


Thanks.


--

Sergey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080905/1c31bb37/attachment.htm>


More information about the erlang-questions mailing list