Re: archive items not in correct section order

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tim Clarke <tim(dot)clarke(at)minerva-analytics(dot)info>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: archive items not in correct section order
Date: 2018-08-28 20:51:51
Message-ID: 13073.1535489511@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tim Clarke <tim(dot)clarke(at)minerva-analytics(dot)info> writes:
> On 27/08/18 15:22, Tom Lane wrote:
>> That's not supposed to happen. Can you create a test case, by any chance?

> It wasn't the cross-tab/pivot, it was this materialized view:

Hm, could I trouble you for a self-contained test case? I tried to
flesh it out as attached, but I'm not seeing any error with this.
So there must be some other moving part ...

regards, tom lane

drop schema rating cascade;
drop schema r cascade;

create schema rating;
create table rating.cy (f1 int, cid int, ye int);

create schema r;

set search_path = r;

create table c(id int);
create table f(id int, cid int, ye int, ytext text);
create table wb(cid int, fid int, prop float8);

CREATE materialized VIEW r.b AS
SELECT
c.id,
f.ytext,
min(coalesce(
(select
case
when wb.prop >= 0.333 then 4
when wb.prop >= 0.25 then 3
when wb.prop >= 0.15 then 2
when wb.prop >= 0.1 then 1
else 0
end
FROM r.wb
where
wb.cid = c.id and
wb.fid = f.id), 0)) as score
FROM
rating.cy,
c,
f
WHERE
c.id = f.cid AND
f.cid = cy.cid AND
f.ye = cy.ye
GROUP BY
1, 2
LIMIT 1;

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Peticolas 2018-08-29 04:02:45 WAL replay issue from 9.6.8 to 9.6.10
Previous Message Jack Cushman 2018-08-28 20:21:24 Re: Duplicating data folder without tablespace, for read access