BUG #5239: Recursive complex query

Поиск
Список
Период
Сортировка
От Recursive complex query
Тема BUG #5239: Recursive complex query
Дата
Msg-id 200912101827.nBAIRlVq031495@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #5239: Recursive complex query  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      5239
Logged by:          Recursive complex query
Email address:      gusta1308@gmail.com
PostgreSQL version: 8.4
Operating system:   Windows XP SP 2
Description:        Recursive complex query
Details:

I try to run following query:

    with recursive data (cid, rid, fini, ffin) as (
      select
        po1.cliente_id,
        po1.ramo_id,
        po1.inicio,
        po1.final
      from tm_polizas po1
        inner join (
          select
            pol.cliente_id,
            pol.ramo_id,
            max(pol.final) final
          from tm_polizas pol
          where pol.final >= (date '2009-01-01')
          group by pol.cliente_id,
            pol.ramo_id
        ) x1
          on x1.cliente_id = po1.cliente_id
          and x1.ramo_id = po1.ramo_id
          and x1.final = po1.final

      union all

      select
        po2.cliente_id,
        po2.ramo_id,
        po2.inicio,
        data.ffin final
      from tm_polizas po2
        inner join data
          on po2.cliente_id = data.cid
          and po2.ramo_id = data.rid
          and po2.final >= (fini - 90)
    )
    select
      cid cliente_id,
      rid ramo_id,
      min(fini) inicio,
      max(ffin) final
    from data
    group by cid, rid;

and the server report me the error: "ERROR:  write failed"

This table contain 5 million rows

Thank

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: BUG #5234: ALTER TABLE ... RENAME COLUMN change view definition incorrectly
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5239: Recursive complex query