Re: bulk load performance question - Mailing list pgsql-performance

From Tom Lane
Subject Re: bulk load performance question
Date
Msg-id 7139.1286918534@sss.pgh.pa.us
Whole thread Raw
In response to bulk load performance question  (Samuel Gendler <sgendler@ideasculptor.com>)
List pgsql-performance
Samuel Gendler <sgendler@ideasculptor.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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: read only transactions
Next
From: "Pierre C"
Date:
Subject: Re: Slow count(*) again...