Carlos Moreno <moreno@mochima.com> writes:
> What I observed is the following: message from FE
> to BE, data: Qinsert into table ......
> Then a reply Pblank.CINSERT.304712345
> (I guess the number is the OID of the record inserted).
That looks fine.
> After that, another message from FE to BE, with an X
> (which is "close connection", if I understand correctly).
> But then, *after* sending that one, the client sends
> another block, starting with an e, or a p. Bang!!
> That's my error.
An X message? The backend should drop the connection and shut down
upon seeing X --- it'll never get as far as noticing the following data.
I think either you misinterpreted the tcp dump, or else things are
already out of sync at that point.
> Of course, in my code, I simply do:
> if (db.Exec (sql_string) != PGRES_COMMAND_OK)
I had not realized that you are using libpq++. It's entirely likely
that the bug is in libpq++ ... that's not the best-written part of the
Postgres universe :-(, and it doesn't get nearly as much testing as,
say, libpq. Still, a quick look at Exec() doesn't reveal any obvious
way that it could do more than the intended PQexec().
I think you need to start digging in libpq++.
regards, tom lane