Re: pg_restore - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_restore
Date
Msg-id 17838.1106442023@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_restore  ("Niederland" <niederland@gmail.com>)
Responses Re: [pgsql-hackers-win32] pg_restore  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: pg_restore  ("Niederland" <niederland@gmail.com>)
List pgsql-general
"Niederland" <niederland@gmail.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?

            regards, tom lane

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: About PostgreSQL 8.0
Next
From: "Quinton Lawson"
Date:
Subject: Windows 2000 Slower Than Windows XP