Re: bulk load performance question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: bulk load performance question
Date: 2010-10-12 21:22:14
Message-ID: 7139.1286918534@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Samuel Gendler <sgendler(at)ideasculptor(dot)com> 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Pierre C 2010-10-12 21:35:01 Re: Slow count(*) again...
Previous Message Tom Lane 2010-10-12 21:16:20 Re: read only transactions