Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fukRf-0003EN-HB for pgsql-general@arkaria.postgresql.org; Tue, 28 Aug 2018 20:18:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fukRd-0001vG-II for pgsql-general@arkaria.postgresql.org; Tue, 28 Aug 2018 20:18:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fujpV-0006XS-Tc for pgsql-general@lists.postgresql.org; Tue, 28 Aug 2018 19:39:09 +0000 Received: from [195.224.43.67] (helo=mail.manifest.co.uk) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fujpT-0003Fi-Lj for pgsql-general@lists.postgresql.org; Tue, 28 Aug 2018 19:39:09 +0000 Received: from tim-573P.m1.manifest.co.uk (79.77.88.252) by remote.manifest.co.uk (192.168.1.4) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 28 Aug 2018 20:39:06 +0100 Subject: Re: archive items not in correct section order To: References: <2efc7f44-2820-6b86-6a45-b46bd32cc44d@minerva-analytics.info> <450.1535379741@sss.pgh.pa.us> <6a3a3c92-bd2e-df53-da3a-877cb41bc7e0@minerva-analytics.info> From: Tim Clarke X-Opacus-Archived: none Organization: Minerva Analytics Ltd Message-ID: <87a088a1-667b-26cb-de58-ca89077d66c2@minerva-analytics.info> Date: Tue, 28 Aug 2018 20:39:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <6a3a3c92-bd2e-df53-da3a-877cb41bc7e0@minerva-analytics.info> Content-Type: multipart/alternative; boundary="------------7FB1D0E0DDDB244E7104C35F" Content-Language: en-GB X-Host-Lookup-Failed: Reverse DNS lookup failed for 195.224.43.67 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --------------7FB1D0E0DDDB244E7104C35F Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On 27/08/18 15:22, Tom Lane wrote: >> That's not supposed to happen. Can you create a test case, by any chance? >> Presumably, it's triggered by some database schema change you made since >> the last successful dump. >> >> regards, tom lane >> It wasn't the cross-tab/pivot, it was this materialized view: 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; I've trimmed it down to even just one row and it still causes the warning "pg_dump: [archiver] WARNING: archive items not in correct section order" It yields this data:  id        | ytext    | score -----------+----------+-------          5 | 1996     |     0 -- Tim Clarke --------------7FB1D0E0DDDB244E7104C35F Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 8bit On 27/08/18 15:22, Tom Lane wrote:

      
That's not supposed to happen.  Can you create a test case, by any chance?
Presumably, it's triggered by some database schema change you made since
the last successful dump.

			regards, tom lane


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

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;

I've trimmed it down to even just one row and it still causes the warning "pg_dump: [archiver] WARNING: archive items not in correct section order"

It yields this data:

 id        | ytext    | score
-----------+----------+-------
         5 | 1996     |     0

--

Tim Clarke

--------------7FB1D0E0DDDB244E7104C35F--