Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 090EBB5DBC6 for ; Tue, 23 Aug 2011 17:18:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 14037-02 for ; Tue, 23 Aug 2011 20:18:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 19B0CB5DBDC for ; Tue, 23 Aug 2011 17:17:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p7NKHbVL003074; Tue, 23 Aug 2011 16:17:37 -0400 (EDT) To: Robert Haas cc: Steve Singer , PostgreSQL-development Hackers Subject: Re: skip WAL on COPY patch In-reply-to: References: <4E53E7D5.6030808@ca.afilias.info> <1739.1314126320@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 23 Aug 2011 16:08:50 -0400" Date: Tue, 23 Aug 2011 16:17:36 -0400 Message-ID: <3073.1314130656@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.405 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.505 X-Spam-Level: X-Archive-Number: 201108/1068 X-Sequence-Number: 193823 Robert Haas writes: > What I think would be really interesting is a way to make this work > when the table *isn't* empty. In other words, have a COPY option that > (1) takes an exclusive lock on the table, (2) writes the data being > inserted into new pages beyond the old EOF, and (3) arranges for crash > recovery or transaction abort to truncate the table back to its > previous length. Then you could do fast bulk loads even into a table > that's already populated, so long as you don't mind that the table > will be excusive-locked and freespace within existing heap pages won't > be reused. What are you going to do with the table's indexes? regards, tom lane