Re: Re: pg_restore fails on Windows - Mailing list pgsql-general

From Tom Lane
Subject Re: Re: pg_restore fails on Windows
Date
Msg-id 1178.1219079897@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_restore fails on Windows  (Tom Tom <cobold@seznam.cz>)
List pgsql-general
=?us-ascii?Q?Tom=20Tom?= <cobold@seznam.cz> writes:
> Magnus Hagander wrote:
>> Attached is a pg_restore.exe off CVS tip today, which should include the
>> patch. Please try this one.

> I tested the restore using the provided pg_restore.exe. The output is:

> pg_restore: [archiver (db)] could not execute query: could not send data to server: No buffer space available
(0x00002747/10055)

According to
http://support.microsoft.com/kb/201213
this is an acknowledged bug that's been broken since Windows 95, so
I suppose we should conclude that M$ is unwilling or incompetent to
fix it.

Possibly the best workaround is something like

+ #ifndef WIN32
        sent = pqsecure_write(conn, ptr, len);
+ #else
+         /* Windows tends to fail on large sends, see KB 20213 */
+         sent = pqsecure_write(conn, ptr, Min(len, 65536));
+ #endif

in pqSendSome().  The backend seems to not be subject to a similar
problem because it's already filtering its output through a limited-size
buffer.

            regards, tom lane

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: failed to re-find parent key in "..."
Next
From: "Francisco Figueiredo Jr."
Date:
Subject: Re: Postres.exe Processes Hang