Re: pg_restore bug on win32

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

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);

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tony Caduto 2005-09-11 01:08:38 Re: pg_restore bug on win32
Previous Message Tom Lane 2005-09-11 00:05:48 Re: pg_restore bug on win32