Antonis Antoniou <a(dot)antoniou(at)albourne(dot)com> writes:
> I get the following message:
> Backend sent D message without prior T
> Does anyone knows about this message? I am expecting to retrieve
> 2818510 records and am using PostgreSQL 7.1beta4.
IIRC, this is a fairly common symptom of the frontend app running out
of memory --- libpq loses sync with what the backend is sending, and
it doesn't handle that very gracefully.
I'd suggest using a cursor to retrieve the data in more manageable
chunks.
regards, tom lane