X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B6E123A1901; Sun, 23 Jan 2005 16:08:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 06410-02; Sun, 23 Jan 2005 16:08:11 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 87B593A19A5; Sun, 23 Jan 2005 16:08:10 +0000 (GMT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j0NG81h01779; Sun, 23 Jan 2005 11:08:01 -0500 (EST) From: Bruce Momjian Message-Id: <200501231608.j0NG81h01779@candle.pha.pa.us> Subject: Re: [pgsql-hackers-win32] pg_restore In-Reply-To: <17838.1106442023@sss.pgh.pa.us> To: Tom Lane Date: Sun, 23 Jan 2005 11:08:01 -0500 (EST) Cc: Niederland , pgsql-general@postgresql.org, pgsql-hackers-win32@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/1246 X-Sequence-Number: 72195 Tom Lane wrote: > "Niederland" 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@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073