Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id F2B899FBE63 for ; Thu, 22 Feb 2007 13:21:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 38171-03-2 for ; Thu, 22 Feb 2007 13:21:30 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web50301.mail.yahoo.com (web50301.mail.yahoo.com [206.190.38.55]) by postgresql.org (Postfix) with SMTP id 1A6FE9FBFDE for ; Thu, 22 Feb 2007 13:21:29 -0400 (AST) Received: (qmail 19017 invoked by uid 60001); 22 Feb 2007 17:21:28 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=2irxMzCZfBXrswNwHKil83zPlERZtlcHRnbVwF3lLktZB5gzwgUaD3QVss/2/NV9lV6bGi7seeVhdVUQ7o3kPqC9zGYzrc+NRBsqy6xnoh0NCcnwXudm3PXmYo4zkCM20vX9q6xNvMwbkIDcoRxko4SHpYeXyDxuL/DMMoDCGP4=; X-YMail-OSG: _01GyC0VM1mgrYy5WmNYIsbsKIdEDKFPVIhLLVPzsOBxrTi5.yt_CQZ.nUsps3D8cRL8CPRVOlGGi1t_iy8mRQpsHAIr6XHGxzI_Ro9ay2YnlaSIkFYzuvujzZOCuimcio9AGq_ZfItrywk- Received: from [58.63.153.142] by web50301.mail.yahoo.com via HTTP; Thu, 22 Feb 2007 09:21:28 PST X-Mailer: YahooMailRC/368.8 YahooMailWebService/0.6.132.8 Date: Thu, 22 Feb 2007 09:21:28 -0800 (PST) From: ogjunk-pgjedan@yahoo.com Subject: Re: Fastest DB restore options To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <584838.18991.qm@web50301.mail.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.317 tagged_above=0 required=5 tests=BAYES_50, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, NO_REAL_NAME X-Spam-Level: **** X-Archive-Number: 200702/294 X-Sequence-Number: 24759 ----- Original Message ----=0AFrom: Tom Lane =0A=0Aogjun= k-pgjedan@yahoo.com writes:=0A> I normally dump with these options:=0A> -= d MyDB --clean --inserts --column-inserts --format=3DP=0A> But the last tim= e I tried that, the restore took foreeeeeeeeeeeeeever.=0A=0A--inserts is pr= etty expensive.=0A=0AOG: right. I won't use -d then.=0A=0A> So I'm lookin= g for the fastest way to import data from the old DB to the new one. Judgi= ng from pg_dump man page the following should be the fastest dump & restore= :=0A=0A> -d MyDB --format=3Dc --ignore-version=0A =0ADon't use --ignore-v= ersion; it's a good way to shoot yourself in the foot.=0A=0AOG: even when u= pgrading (8.0.3 -> 8.2.3)? I'll dump with pg_dump from 8.0.3 and them impo= rt with pg_restore from the newly installed 8.2.3. Wouldn't I *have to* us= e --ignore-version for that to work?=0A=0Apg_dump's default behavior is abo= ut as good as you can get; there are no=0Aoptional switches that will make = it faster. What you *can* do is make=0Asure that the receiving system is p= roperly configured before you start=0Athe restore --- increase maintenance_= work_mem and checkpoint_segments=0Ain particular. See this page, especiall= y the last section:=0Ahttp://www.postgresql.org/docs/8.2/static/populate.ht= ml=0A=0AOG: Thanks for the pointer!=0A=0AOtis=0A=0A=0A