Re: [GENERAL] Commit every N rows in PL/pgsql

2010-07-06 Thread Howard Rogers
On 06/03/2010 08:26 AM, Chris Browne wrote: len.wal...@gmail.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

Re: [GENERAL] Commit every N rows in PL/pgsql

2010-06-03 Thread Len Walter
> > > > ... > > AfterTriggerEvents: 2642403328 total in 327 blocks; 10176 free (319 > > chunks); 2642393152 used > > And there's the problem. Evidently you have an AFTER trigger on the > table, and the queued events for that trigger are overrunning memory. > That's interesting - I don't know

Re: [GENERAL] Commit every N rows in PL/pgsql

2010-06-02 Thread Chris Browne
Chris Browne writes: > len.wal...@gmail.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. >

Re: [GENERAL] Commit every N rows in PL/pgsql

2010-06-02 Thread Chris Browne
len.wal...@gmail.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

Re: [GENERAL] Commit every N rows in PL/pgsql

2010-05-26 Thread Tom Lane
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. >> >> That's unusual, what is the error you get?

Re: [GENERAL] Commit every N rows in PL/pgsql

2010-05-26 Thread Len Walter
> > 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. > > That's unusual, what is the error you get? Here it is: TopMemoryCont

Re: [GENERAL] Commit every N rows in PL/pgsql

2010-05-26 Thread hubert depesz lubaczewski
On Wed, May 26, 2010 at 04:27:22PM +1000, Len Walter wrote: > Hi, > > 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. > In Or

Re: [GENERAL] Commit every N rows in PL/pgsql

2010-05-26 Thread Alban Hertroys
On 26 May 2010, at 8:27, Len Walter wrote: > Hi, > > 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. That's unusual, what

Re: [GENERAL] Commit every N rows in PL/pgsql

2010-05-26 Thread Pavel Stehule
Hello it is useless in PostgreSQL - it isn't important if you commit one or billion updated rows. PostgreSQL has different implementation of transactions, so some Oracle's issues are not here. Regards Pavel Stehule 2010/5/26 Len Walter : > Hi, > I need to populate a new column in a Postgres 8.3

Re: [GENERAL] Commit every N rows in PL/pgsql

2010-05-26 Thread Jaime Casanova
On Wed, May 26, 2010 at 1:27 AM, Len Walter wrote: > > PL/pgsql doesn't allow that because it doesn't support nested transactions. > Is there an equivalent Postgres way of doing this? what about this? create function f() returns void as $$ declare r record; begin for r in select col_a fro

[GENERAL] Commit every N rows in PL/pgsql

2010-05-25 Thread Len Walter
Hi, 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. In Oracle, I'd turn auto-commit off and write a pl/sql procedure that keeps a