Re: Out of memory error

Поиск
Список
Период
Сортировка
От Clodoaldo Pinto
Тема Re: Out of memory error
Дата
Msg-id a595de7a0502071341d642a1e@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Out of memory error  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: Out of memory error
Список pgsql-general
On Mon, 07 Feb 2005 09:32:47 -0800, Joshua D. Drake
<jd@commandprompt.com> wrote:
>
> >
> > Any advice on how to avoid it?
>
> Use a cursor.
>
Same thing using a cursor:

declare
    rdata record;
begin
truncate table usuarios2;
for rdata in
select distinct on (data) data
from usuarios
loop
insert into usuarios2
    (
    data,
    usuario,
    pontos,
    wus
    )
select
    data,
    usuario,
    sum(pontos),
    sum(wus)
from usuarios
where data = rdata.data
group by data, usuario
;
end loop;
return;
end;

В списке pgsql-general по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Creating an index-type for LIKE '%value%'
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Sorting when "*" is the initial character