Re: [GENERAL] pg_restore

Bruce Momjian <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32,gmane.comp.db.postgresql.general
Message-ID <[email protected]>
Tom Lane wrote:
> "Niederland" <[email protected]> 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
  [email protected]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.