Krok <krok(at)void(dot)ru> writes:
> pg_dump: dumping contents of table users
> pg_dump: ERROR: out of memory
> DETAIL: Failed on request of size 536870920.
> pg_dump: SQL command to dump the contents of table "users" failed:
> PQendcopy() failed.
> pg_dump: Error message from server: ERROR: out of memory
> DETAIL: Failed on request of size 536870920.
Looks like corrupt data to me (specifically, a variable-width field
with a ridiculous length word).
You may care to consult the archives regarding methods for dealing with
this sort of problem. If you're lucky, there's only one bad row ...
regards, tom lane