X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DE0EF53433 for ; Thu, 24 Mar 2005 16:44:48 +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 88358-10 for ; Thu, 24 Mar 2005 16:44:41 +0000 (GMT) Received: from sunsite.dcc.uchile.cl (sunsite.dcc.uchile.cl [192.80.24.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6236F53469 for ; Thu, 24 Mar 2005 16:44:40 +0000 (GMT) Received: from anakena.dcc.uchile.cl (anakena [192.80.24.6]) by sunsite.dcc.uchile.cl (8.12.11/8.12.11) with ESMTP id j2OGiXJg006883; Thu, 24 Mar 2005 12:44:33 -0400 (CLT) Received: by anakena.dcc.uchile.cl (Postfix, from userid 4151) id 4552C52D69; Thu, 24 Mar 2005 12:44:33 -0400 (CLT) Date: Thu, 24 Mar 2005 12:44:33 -0400 From: Alvaro Herrera To: Tom Lane Cc: Lee Wu , pgsql-admin@postgresql.org Subject: Re: pg_dump, pg_restore, insert vs copy Message-ID: <20050324164433.GA8068@dcc.uchile.cl> References: <27059.1111679526@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27059.1111679526@sss.pgh.pa.us> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.348 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200503/397 X-Sequence-Number: 16895 On Thu, Mar 24, 2005 at 10:52:06AM -0500, Tom Lane wrote: > "Lee Wu" writes: > > When I use pg_dump to back up the whole database and then pg_restore an > > individual table, > > pg_restore uses COPY. Great. > > When I use pg_dump to back up an individual table and pg_restore it, > > pg_restore uses INSERT. > > Not for me... > > That decision is fixed at pg_dump time; it's not possible for pg_restore > to change it, because the data is already that way (or not) in the dump > file. Maybe you misinterpreted what you saw? Is there any reason why we don't use a binary storage in custom format dumps? I mean, we could open a binary cursor and write the results to the file, and read it back at restore time. This is just handwaving of course. I guess the reason is cross-version portability? -- Alvaro Herrera () "World domination is proceeding according to plan" (Andrew Morton)