I'm hoping this is an appropriate place to post my problem attempting to use the ejabberd postgres driver in my own code...<br><br>I have a postgresql table whose format is like this:<br><br>mydb=# \d attachments<br>                           Table "
public.attachments"<br> Column |  Type   |                          Modifiers <br>                          --------+---------+--------------------------------------------------------------<br> atchid | bigint  | not null default nextval('attachments_atchid_seq'::regclass)
<br> msgkey | bigint  | not null<br> docid  | bigint  | not null<br> parent | bigint  | <br> name   | text    | <br> body   | boolean | <br>Indexes:<br>    "attachments_pkey" PRIMARY KEY, btree (atchid)<br>    "attachments_msgkey_key" UNIQUE, btree (msgkey, docid, parent, name)
<br>Foreign-key constraints:<br>    "attachments_docid_fkey" FOREIGN KEY (docid) REFERENCES documents(docid) ON UPDATE CASCADE ON DELETE CASCADE<br>    "attachments_msgkey_fkey" FOREIGN KEY (msgkey) REFERENCES messages(msgkey) ON UPDATE CASCADE ON DELETE CASCADE
<br>    "attachments_parent_fkey" FOREIGN KEY (parent) REFERENCES attachments(atchid) ON UPDATE CASCADE ON DELETE CASCADE<br><br><br>In erlang, I do the following and get the pasted-in error:<br><br><br>7> {ok, Db} = pgsql:connect("localhost", "mydb", "me", ""). 
<br>Params: [{secret,{7183,274541943}},<br>         {{parameter,"TimeZone"},"CST6CDT"},<br>         {{parameter,"standard_conforming_strings"},"off"},<br>         {{parameter,"session_authorization"},"me"},
<br>         {{parameter,"server_version"},"8.1.5"},<br>         {{parameter,"server_encoding"},"UTF8"},<br>         {{parameter,"is_superuser"},"on"},<br>         {{parameter,"integer_datetimes"},"off"},
<br>         {{parameter,"DateStyle"},"ISO, MDY"},<br>         {{parameter,"client_encoding"},"UTF8"}]<br>{ok,<0.44.0>}<br>8> pgsql:squery(Db, "SELECT * FROM Attachments").
<br><br>=ERROR REPORT==== 10-Dec-2007::11:55:35 ===<br>Error in process <0.44.0> with exit value: {badarg,[{erlang,binary_to_list,[null]},{pgsql_proto,'-process_squery_cols/1-fun-0-',1},{lists,map,2},{lists,map,2},{pgsql_proto,process_squery_cols,1},{pgsql_proto,process_squery,1},{pgsql_proto,idle,2}]}
<br><br>** exited: {badarg,[{erlang,binary_to_list,[null]},<br>                    {pgsql_proto,'-process_squery_cols/1-fun-0-',1},<br>                    {lists,map,2},<br>                    {lists,map,2},<br>                    {pgsql_proto,process_squery_cols,1},
<br>                    {pgsql_proto,process_squery,1},<br>                    {pgsql_proto,idle,2}]} **<br><br>I really don't understand erlang tracebacks yet, so this error message is pure greek to me.  Does anyone have a clue what is causing this, or where I can start to debug this?
<br> <br>Other database stuff works, like so:<br><br>2> pgsql:squery(Db, "CREATE TEMP TABLE TEST(key bigint primary key)").<br>{ok,["CREATE TABLE"]}<br>3> pgsql:squery(Db, "SELECT * FROM TEST").
<br>{ok,[{"SELECT",[{desc,1,"key",20,text,8,-1,121252}],[]}]}<br>4> pgsql:squery(Db, "INSERT INTO TEST VALUES(1)").<br>{ok,["INSERT 0 1"]}<br>5> pgsql:squery(Db, "SELECT * FROM TEST"). 
<br>       {ok,[{"SELECT",[{desc,1,"key",20,text,8,-1,121252}],[["1"]]}]}<br><br>So it looks like there's something about my table that's making the pg driver die.  Can anyone see what's happening?
<br>