Unix Technical Forum

=?us-ascii?Q?Re=3A=20Re=3A=20pg=5Frestore=20fails=20on= 20Windows?=

This is a discussion on =?us-ascii?Q?Re=3A=20Re=3A=20pg=5Frestore=20fails=20on= 20Windows?= within the Pgsql General forums, part of the PostgreSQL category; --> Magnus Hagander wrote > Tom Lane wrote: > > =?us-ascii?Q?Tom=20Tom?= <cobold@seznam.cz> writes: > >> Magnus Hagander wrote: > >>> ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-21-2008, 10:59 PM
=?us-ascii?Q?Tom=20Tom?=
 
Posts: n/a
Default =?us-ascii?Q?Re=3A=20Re=3A=20pg=5Frestore=20fails=20on= 20Windows?=

Magnus Hagander wrote
> Tom Lane wrote:
> > =?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.

>
> Yup, I was just reading that one when I saw your email. I finally got
> around to building a libpq with this change in it - attached here. Tom
> (not Lane), can you test this please?
>
> It shouldn't be this one really, since it doesn't list any modern
> Windows versions as having this issue, but it's worth a try.


Tested. The restore comes through successfuly with the patched libpq.
So I take it that it's caused by the MS issue. Again, we are using WinXP Professional SP2. Perhaps the
system buffer space was _increased_ in XP (10MB comes through easily),
still if the block is too large, it occurs (speculation).

Since I don't know the implementation details of the patch I'd like to ask:
1.This is not official patch, didn't pass the review/test cycle; do you think that it can be used in the
production environment (any side effects or so..)? If not, is the patch due for a next version?

2.Our production PG version is 8.1.3. For some reasons it is not possible to upgrade to the LATEST;
I tested the libpq also on this version and it worked. Is it OK? I mean, did it worked by chance or the library
API & contracts didn't change between this version and latest?

>
> One other thing not asked here btw - is this over SSL or not?


SSL is out of game, we are not using 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.

>
> The other option would be to turn off buffering in the sockets per the
> third bulletpoint. But I think that's an even uglier solution.
>


Regards, Tomas

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-21-2008, 10:59 PM
Magnus Hagander
 
Posts: n/a
Default Re: pg_restore fails on Windows

Tom Tom wrote:
> Magnus Hagander wrote
>> Tom Lane wrote:
>>> =?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.

>> Yup, I was just reading that one when I saw your email. I finally got
>> around to building a libpq with this change in it - attached here. Tom
>> (not Lane), can you test this please?
>>
>> It shouldn't be this one really, since it doesn't list any modern
>> Windows versions as having this issue, but it's worth a try.

>
> Tested. The restore comes through successfuly with the patched libpq.
> So I take it that it's caused by the MS issue. Again, we are using WinXP Professional SP2. Perhaps the
> system buffer space was _increased_ in XP (10MB comes through easily),
> still if the block is too large, it occurs (speculation).


Yes, that sounds quite likely. They fixed the symptoms, but not the
underlying problem.


> Since I don't know the implementation details of the patch I'd like to ask:
> 1.This is not official patch, didn't pass the review/test cycle; do you think that it can be used in the
> production environment (any side effects or so..)? If not, is the patch due for a next version?


I plan to apply it to HEAD and supported back-branches (8.3 and 8.2) now
that you have verified that it works, so it will be in the next
versions. The only potential side-effect is that it will be slightly
slower on packets >64kb, but I doubt that's even measurable in most cases.

So yes, it should be safe to use in production.


> 2.Our production PG version is 8.1.3. For some reasons it is not possible to upgrade to the LATEST;
> I tested the libpq also on this version and it worked. Is it OK? I mean, did it worked by chance or the library
> API & contracts didn't change between this version and latest?


Note that libpq is only the *client* side. There is no patch necessary
on the server. It might be easier to upgrade than the server?

Did you test it with the pg_restore that I sent, or with the one from
8.1? The pg_restore I sent was for HEAD, as well as the libpq I sent, so
you shouldn't use those in production long-term.

For binaries, we don't provide backpatches for 8.1 any more (it's not a
supported platform on Windows!), but you might be able to use the latest
8.2 libpq with the 8.1 pg_restore - you'll have to try that once the
release is eventually out.

Or you can just apply the patch to the latest 8.1 libpq and build it
yourself, of course. I think it should apply just fine.

//Magnus


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-21-2008, 10:59 PM
=?us-ascii?Q?Tom=20Tom?=
 
Posts: n/a
Default =?us-ascii?Q?Re=3A=20pg=5Frestore=20fails=20on=20Window s?=

Magnus Hagander wrote
> Tom Tom wrote:
> > Magnus Hagander wrote
> >> Tom Lane wrote:
> >>> =?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.
> >> Yup, I was just reading that one when I saw your email. I finally got
> >> around to building a libpq with this change in it - attached here. Tom
> >> (not Lane), can you test this please?
> >>
> >> It shouldn't be this one really, since it doesn't list any modern
> >> Windows versions as having this issue, but it's worth a try.

> >
> > Tested. The restore comes through successfuly with the patched libpq.
> > So I take it that it's caused by the MS issue. Again, we are using WinXP

> Professional SP2. Perhaps the
> > system buffer space was _increased_ in XP (10MB comes through easily),
> > still if the block is too large, it occurs (speculation).

>
> Yes, that sounds quite likely. They fixed the symptoms, but not the
> underlying problem.
>
>
> > Since I don't know the implementation details of the patch I'd like to ask:
> > 1.This is not official patch, didn't pass the review/test cycle; do you think

> that it can be used in the
> > production environment (any side effects or so..)? If not, is the patch due

> for a next version?
>
> I plan to apply it to HEAD and supported back-branches (8.3 and 8.2) now
> that you have verified that it works, so it will be in the next
> versions. The only potential side-effect is that it will be slightly
> slower on packets >64kb, but I doubt that's even measurable in most cases.
>
> So yes, it should be safe to use in production.
>
>
> > 2.Our production PG version is 8.1.3. For some reasons it is not possible to

> upgrade to the LATEST;
> > I tested the libpq also on this version and it worked. Is it OK? I mean, did

> it worked by chance or the library
> > API & contracts didn't change between this version and latest?

>
> Note that libpq is only the *client* side. There is no patch necessary
> on the server. It might be easier to upgrade than the server?


This I didn't know/realize. It's good enough for us to use only the *client* side from the HEAD.
I tried the pg_restore from HEAD + patched libpq (on 8.1 installation) and it complained about missing zlib1 library. When
supplied, next was libintl3 dll. Further I didn't check. Obviously the library dependencies have changed since the 8.1.
How can I tell, which libraries/executables/resources of the installation are part of the *client* side (namely pg_restore),
so that I can use it independently from the server version?

>
> Did you test it with the pg_restore that I sent, or with the one from
> 8.1? The pg_restore I sent was for HEAD, as well as the libpq I sent, so
> you shouldn't use those in production long-term.
>
> For binaries, we don't provide backpatches for 8.1 any more (it's not a
> supported platform on Windows!), but you might be able to use the latest
> 8.2 libpq with the 8.1 pg_restore - you'll have to try that once the
> release is eventually out.
>
> Or you can just apply the patch to the latest 8.1 libpq and build it
> yourself, of course. I think it should apply just fine.
>


Tomas

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-21-2008, 10:59 PM
Magnus Hagander
 
Posts: n/a
Default Re: pg_restore fails on Windows

>>> 2.Our production PG version is 8.1.3. For some reasons it is not possible to
>> upgrade to the LATEST;
>>> I tested the libpq also on this version and it worked. Is it OK? I mean, did

>> it worked by chance or the library
>>> API & contracts didn't change between this version and latest?

>> Note that libpq is only the *client* side. There is no patch necessary
>> on the server. It might be easier to upgrade than the server?

>
> This I didn't know/realize. It's good enough for us to use only the *client* side from the HEAD.
> I tried the pg_restore from HEAD + patched libpq (on 8.1 installation) and it complained about missing zlib1 library. When
> supplied, next was libintl3 dll. Further I didn't check. Obviously the library dependencies have changed since the 8.1.
> How can I tell, which libraries/executables/resources of the installation are part of the *client* side (namely pg_restore),
> so that I can use it independently from the server version?


That is correct, there have been a lot of changes there - mainly in that
8.3 and up are compiled with MSVC which changes some dependencies. I
would suggest you install the latest 8.3 from the MSI installer. You can
then select the client side only. It is no problem to have both 8.1 and
8.3 installed on the same machine at the same time (or you can install
it on a different machine and just copy the necessary files over)


//Magnus


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-27-2008, 06:00 PM
Junior Member
 
Join Date: Aug 2008
Posts: 1
Question Need a solution for pg_restore wit large binary data

Hello,

i try to restore a Dump with large binary Data into postgressql an a Windows server and get the known error ("No buffer space available (0x00002747/10055")). I use Postgres Version 8.3.3 on the MS Server.
I must migrate the Date from an old postgresql 8.0 Linux version to the actual version on Windows.
You write about a fixed libpq. Is it a solution for this problem? Can you please tell me where to find the fixed library or can you send it to me?
Thanks for your help

Best regards
John
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads for: =?us-ascii?Q?Re=3A=20Re=3A=20pg=5Frestore=20fails=20on= 20Windows?=

Thread Thread Starter Forum Replies Last Post
=?us-ascii?Q?Re=3A=20pg=5Frestore=20fails=20on=20Windows?= =?us-ascii?Q?Tom=20Tom?= Pgsql General 16 09-12-2008 05:26 PM
=?us-ascii?Q?Re=3A=20pg=5Frestore=20fails=20on=20Windows?= =?us-ascii?Q?Tom=20Tom?= Pgsql General 1 08-18-2008 07:22 PM
=?iso-8859-1?Q?R=E9f=2E_=3A_Mysql_=3A_=2Fsoft=2Fmysql=2Flibexec=2Fmysqld?==?us-ascii?Q?=3A_?= =?us-ascii?Q?Can?= =?us-ascii?Q?'?= =?us-ascii?Q?t?= abdel.ramli@mpsa.com Apache Users 0 08-15-2008 08:27 PM
=?us-ascii?Q?Re=3A=20=5BGENERAL=5D=20pg=5Frestore=20fails=20on=20Windows?= =?us-ascii?Q?Tom=20Tom?= Pgsql General 0 08-13-2008 11:24 AM
=?us-ascii?Q?pg=5Frestore=20problems?= =?us-ascii?Q?Bobby=20Gontarski?= Pgsql General 2 04-09-2008 12:09 PM


All times are GMT. The time now is 11:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com