Re: Commit every N rows in PL/pgsql

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Commit every N rows in PL/pgsql
Date: 2010-06-02 22:29:53
Message-ID: 876321vzj2.fsf@cbbrowne-laptop.afilias-int.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris Browne <cbbrowne(at)acm(dot)org> writes:
> len(dot)walter(at)gmail(dot)com (Len Walter) writes:
>> I need to populate a new column in a Postgres 8.3 table. The SQL would be something like "update t set col_c = col_a +
>> col_b". Unfortunately, this table has 110 million rows, so running that query runs out of memory.
>
> Unnecessary. On Oracle, the typical scenario is "ORA-1562 FAILED TO
> EXTEND ROLLBACK SEGMENT."
>
> PostgreSQL doesn't have a rollback segment, so there's nothing to run
> out of here. Where Oracle would tend to encourage you to keep your
> transactions rather small, PostgreSQL doesn't require you to care about
> that.
>
> Big transactions, on PostgreSQL, are really no big deal.

Unless, of course, there's a trigger on that table. In which case
it's pretty likely that you'd want to suppress the trigger...
--
select 'cbbrowne' || '@' || 'cbbrowne.com';
http://cbbrowne.com/info/internet.html
"MS apparently now has a team dedicated to tracking problems with
Linux and publicizing them. I guess eventually they'll figure out
this back fires... ;)" -- William Burrow <aa126(at)DELETE(dot)fan(dot)nb(dot)ca>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message federalbird 2010-06-02 22:42:54 Query Slow in Postgres 8.4.3 than Postgres 8.1.5
Previous Message raghavendra t 2010-06-02 22:29:20 Re: How do we get the Client-Time and Server-Time from psql ?