Skip site navigation (1) Skip section navigation (2)

Re: [pgsql-hackers-win32] pg_restore

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Niederland <niederland(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org,pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: [pgsql-hackers-win32] pg_restore
Date: 2005-01-23 16:08:01
Message-ID: 200501231608.j0NG81h01779@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers-win32
Tom Lane wrote:
> "Niederland" <niederland(at)gmail(dot)com> writes:
> > System: the released Postgres 8.0, winXP
> 
> > Using:
> > pg_dump --format=t --blobs myDB > DBFile
> > pg_restore --create -dbname=crm DBFile
> 
> > Resulted in:
> > pg_restore: [archiver] unsupported version (1.13) in file header
> 
> Come to think of it, I'll bet that you cannot use "> DBFile" on Windows
> because it ends up opening the archive file in text instead of binary
> mode.  SetOutput() in pg_backup_archiver.c tries to work around this by
> doing
> 
> 	fn = fileno(stdout);
> 	AH->OF = fdopen(dup(fn), PG_BINARY_W);
> 
> but it wouldn't surprise me in the least to learn that that doesn't work
> on Windows.
> 
> Does it work if you use
> 	pg_dump --format=t --blobs -f DBFile myDB
> ?  Can anyone on pgsql-hackers-win32 think of a way around this?

I never considered the distinction of binary/text mode on ">" but I can
see it could certainly be an issue.

Do we have to start suggesting "-f" for all scripts just so Win32 is OK?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-hackers-win32 by date

Next:From: Edin KadribasicDate: 2005-01-23 17:24:00
Subject: Re: Include files for static VC libpq.lib
Previous:From: Bruce MomjianDate: 2005-01-23 14:55:53
Subject: Re: [PATCHES] 300 seconds in less than 1 second

pgsql-general by date

Next:From: Devrim GUNDUZDate: 2005-01-23 16:20:09
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while
Previous:From: Alvaro HerreraDate: 2005-01-23 15:57:18
Subject: Re: Dead-end in PostgreSQL 8.0 fresh installation (while

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group