Re: pg_restore bug on win32

From: Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_restore bug on win32
Date: 2005-09-11 01:08:38
Message-ID: 43238396.1090806@amsoftwaredesign.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>I wrote:
>
>
>>Hmm. The only relevant-looking change between 8.0.0 and 8.0.1 is
>>this one:
>>http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/pg_backup_archiver.c.diff?r1=1.101.4.2;r2=1.101.4.3;f=h
>>I wonder if this could be messing up the password acceptance --- for
>>instance, by causing CR or LF to not be stripped off what you type.
>>
>>
>
>I've applied a patch that should fix it if that is the source of the
>problem. I can't test it though, for lack of a Windows setup.
>
> regards, tom lane
>
>Index: pg_backup_archiver.c
>===================================================================
>RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v
>retrieving revision 1.101.4.7
>diff -c -r1.101.4.7 pg_backup_archiver.c
>*** pg_backup_archiver.c 17 May 2005 17:30:41 -0000 1.101.4.7
>--- pg_backup_archiver.c 11 Sep 2005 00:32:33 -0000
>***************
>*** 1714,1724 ****
>
> /*
> * On Windows, we need to use binary mode to read/write non-text archive
>! * formats. Force stdin/stdout into binary mode in case that is what
> * we are using.
> */
> #ifdef WIN32
>! if (fmt != archNull)
> {
> if (mode == archModeWrite)
> setmode(fileno(stdout), O_BINARY);
>--- 1714,1725 ----
>
> /*
> * On Windows, we need to use binary mode to read/write non-text archive
>! * formats. Force stdin/stdout into binary mode if that is what
> * we are using.
> */
> #ifdef WIN32
>! if (fmt != archNull &&
>! (AH->fSpec == NULL || strcmp(AH->fSpec, "") == 0))
> {
> if (mode == archModeWrite)
> setmode(fileno(stdout), O_BINARY);
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: don't forget to increase your free space map settings
>
>
>
>
If someone can create a binary, I can test it in my environment.

Tony

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-09-11 02:04:16 Re: pg_restore stuck in a loop?
Previous Message Tom Lane 2005-09-11 00:39:30 Re: pg_restore bug on win32