Re: Still intrigued... (was: Socket command type e unknown) - Mailing list pgsql-general

From Tom Lane
Subject Re: Still intrigued... (was: Socket command type e unknown)
Date
Msg-id 7302.1046302472@sss.pgh.pa.us
Whole thread Raw
In response to Still intrigued... (was: Socket command type e unknown)  (Carlos Moreno <moreno@mochima.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Richard Welty
Date:
Subject: Re: 7.4?
Next
From: Tom Lane
Date:
Subject: Re: Is renaming a database easy or dangerous