Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 852EC1337BE0 for ; Tue, 12 Oct 2010 18:22:25 -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 42784-04 for ; Tue, 12 Oct 2010 21:22:17 +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 87F501337BE3 for ; Tue, 12 Oct 2010 18:22:16 -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 o9CLMEaT007140; Tue, 12 Oct 2010 17:22:14 -0400 (EDT) To: Samuel Gendler cc: pgsql-performance@postgresql.org Subject: Re: bulk load performance question In-reply-to: References: Comments: In-reply-to Samuel Gendler message dated "Tue, 12 Oct 2010 14:16:11 -0700" Date: Tue, 12 Oct 2010 17:22:14 -0400 Message-ID: <7139.1286918534@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/181 X-Sequence-Number: 40600 Samuel Gendler writes: > Is there some way to do the drop+rename in a manner which will preserve the > OID or otherwise allow blocked queries to execute correctly once they > unblock? No, but you could consider begin; truncate original_table; insert into original_table select * from new_data; commit; > A secondary issue is that if permissions were granted to a role on the old > table, the new table does not acquire those permissions and they must be > granted again. Not to mention foreign keys ... regards, tom lane