Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qot6S-003LWI-JY for pgsql-www@arkaria.postgresql.org; Fri, 06 Oct 2023 22:15:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qot6P-00Cq7o-V9 for pgsql-www@arkaria.postgresql.org; Fri, 06 Oct 2023 22:15:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qot6P-00Cq7f-NJ for pgsql-www@lists.postgresql.org; Fri, 06 Oct 2023 22:15:22 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qot6N-000ffM-Iw for pgsql-www@lists.postgresql.org; Fri, 06 Oct 2023 22:15:21 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-278f0f565e2so1910165a91.2 for ; Fri, 06 Oct 2023 15:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hagander-net.20230601.gappssmtp.com; s=20230601; t=1696630516; x=1697235316; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MrLl0CP+erFlqcyhN7XtQ2Wzt5z7VQorvOkPFkWd/yQ=; b=iU8YFNUtQNue0tEqKKgHUuK8s+P0xmQWuXRsLTDSId0jpmxSb35oZ72jktNgNn/JdS etKK7p7pB5L56qEPoaZaAohKYrFn4wPWwrYJXbcOtROkY/909Ca9Pjw0yY839xkxMZlO Dc8XKx1gpg3QMpqaM7UK/hbcasU2WTQYLXgmI0ZnlXdoVipV25L7/7pOg86iBOkA2+Tk aniNUF8oCc47s8bKnmG3Xe757VbRDZg9fC+h5xEKJlos3i/8ie4lc/36yvWzTzC66vJ1 hVdNQspI7hzYxLSGI/erXCxggVociawtOeZw3boS+J/+gjjAppskFH75C6TmzcNnpqdl REqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696630516; x=1697235316; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MrLl0CP+erFlqcyhN7XtQ2Wzt5z7VQorvOkPFkWd/yQ=; b=ML+ESrDOLaijWxV19jMAR4We1Ym0EY6h9SX6TlYRWX8JboJJpe4wHrCT3KPnuZ2gd3 4BtPYj7iSDGhVcxNV2pR/zi1cT/hlKz27B+d4g7O7hZrENL73xs0YDS6P1K9p+0LFTAZ 0XkYs4r2VBp4ARf1YtPzHQbw3VT7DvNXGa/lPRI3PFls0mDplMQyGuOYr9skVp6akhg5 6S7PmvhVsbpGwqEBBpT6YFYvSj8itSahkOPHfoBA9RjCo1kEMcKR5SSkkVu/7viP1yIS 3KfQE4LAkMK3m/7RRPCLE/W5f929NbgXc1ff3GTTGzx2eSIi2Cw8zTT3tvIxQX4Zz9Id oeRw== X-Gm-Message-State: AOJu0YwOQI6xhZAHN/v3/gxN1+S2kWL8dKq5e2E5KtE8lHwjFvD7g6gy xfVmPeosPER7T49iV3jbECvBLgiVFQZNPrB+/GjLog== X-Google-Smtp-Source: AGHT+IEKcP5ytCY1iTAvMyAzyoLB7ijnWnbC7nklJjrNt0HdRkxpREoqzBtR9lBqnkJYpWLYwSKYd7gsQFTL0abjfaY= X-Received: by 2002:a17:90b:1b0e:b0:279:8c61:47fa with SMTP id nu14-20020a17090b1b0e00b002798c6147famr9120252pjb.4.1696630516111; Fri, 06 Oct 2023 15:15:16 -0700 (PDT) MIME-Version: 1.0 References: <8a949577-ce99-4590-9f31-3fc5d5c162f6@cmatte.me> In-Reply-To: <8a949577-ce99-4590-9f31-3fc5d5c162f6@cmatte.me> From: Magnus Hagander Date: Fri, 6 Oct 2023 18:15:04 -0400 Message-ID: Subject: Re: pglister: issue with materialized view after upgrade (+ solution) To: =?UTF-8?Q?C=C3=A9lestin_Matte?= Cc: PostgreSQL WWW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 29, 2023 at 11:17=E2=80=AFAM C=C3=A9lestin Matte wrote: > > After upgrading postgresql (with pg_upgradecluster), I got the following = error when loading pglister's /moderate page: > > django.db.utils.NotSupportedError: CONCURRENTLY cannot be used when the m= aterialized view is not populated > > It seems like the eximintegration.queue materialized view was lost in the= upgrade process. It's originally created in Django's very first migration. > > The fix was to run directly in the database: refresh materialized view ex= imintegration.queue; > > From there, two things could be done: > - Document it somewhere? > - Push a patch to somehow avoid this issue from happening or adding a tra= nsparent workaround? > > What do you think? Hm. I guess the problem here is that `pg_dump -s` creates the view WITH NO DATA. But how exactly did you run the upgrade -- a normal `pg_dump` of a pglister database will include a `REFRESH MATERIALIZED VIEW` command right at the end. This may be an issue in how pg_upgradecluster executes it perhaps? --=20 Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/