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 1fiG6P-0005fA-CM for pgsql-general@arkaria.postgresql.org; Wed, 25 Jul 2018 09:29:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fiG6K-0007x6-J2 for pgsql-general@arkaria.postgresql.org; Wed, 25 Jul 2018 09:28:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiG6K-0007wz-5P for pgsql-general@lists.postgresql.org; Wed, 25 Jul 2018 09:28:56 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fiG6D-0004zH-Ff for pgsql-general@lists.postgresql.org; Wed, 25 Jul 2018 09:28:54 +0000 Received: by mail-ed1-x541.google.com with SMTP id r4-v6so6612327edp.9 for ; Wed, 25 Jul 2018 02:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=g8dObylThjf48vBLUtxCjvbfqBO01Ee9C0AHgvB0ims=; b=qEzvKinapJhIus/zWKXy0jruEYDR8Jfb55W3xzE4/u/DeM2KGm4gz4Lk8LumikylGJ J8YMe6CC5QWok9g3IgPUA6nu5JsvZIt/8sIAGKeixE+GoQcKJuwNGqatDBXoBIRpYO6v AUUEVRTNcmJd1IzNgP5gw/rtdS1Qdigh7hDa9gq6yGDx5TyQ+TMDvA5j1alewNPe+KkW 4MpriibXpnOEM/6OvVgjtQdLh4BTgzLwCotMxB6jnnl7FhmC/BP23CKveuo85n8tWM2V xq89DlVo/lrzuTzfBtgScpNXSr5lfEexu6hTExSuhKCZ3zrg/jSIDkM2na0/xn+jA8Yx deiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=g8dObylThjf48vBLUtxCjvbfqBO01Ee9C0AHgvB0ims=; b=AzAH90CYMJlxgz/jmutBlgwTb6E77VLrf7VU/F1oHK/Kf4SfQCUm/ICzZeV9TKnnzK usYBikXAWSFhF9k4CtWpYWVAWzNiXM6K1r7Nw7TXj6iXw6I1rfZAjEV6iX7bzO2Nf6kE uKRUlTbQSo4Hn5upw+DD1BN3hqqshYnhFosfJjtR+OaPXAbcHHHmOVlr7jtKrxHGifQM CWDXrKt34OMA9lannvS5pPJ0si9OyiIpyF0pKf29loocvzHWmtyC1Crf7AWh4Yw87KUu 73H6Gb5sBfoZHDl1xafSbZI0vEBXqxaDmiCubW3+mRQVtrkWFcehIKW0Dz/wPpHwHLB4 4EQQ== X-Gm-Message-State: AOUpUlEZQgHtSO0i4+eeANOUCOXa+Ed7996AcfYnx/ML6o1gCaFzb81H AXLK4xg8lOwlhora0cpUm1E= X-Google-Smtp-Source: AAOMgpe6J3kvsiArWBqqOMAh5OSgUzS/K2af12YAj6ixr/oZO2CSUcH7TCEtvMwI364wGwDh7otBdg== X-Received: by 2002:a50:e286:: with SMTP id p6-v6mr22314624edl.253.1532510927918; Wed, 25 Jul 2018 02:28:47 -0700 (PDT) Received: from hollewijn.internal (84-245-13-9.dsl.cambrium.nl. [84.245.13.9]) by smtp.gmail.com with ESMTPSA id k4-v6sm6848520edl.22.2018.07.25.02.28.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 02:28:47 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Restore from dumps From: Alban Hertroys In-Reply-To: Date: Wed, 25 Jul 2018 11:28:45 +0200 Cc: pgsql-general@lists.postgresql.org, Alessandro Aste Content-Transfer-Encoding: quoted-printable Message-Id: <80053159-EE7C-4F76-93E9-FCF5C2169E91@gmail.com> References: To: Nicola Contu X-Mailer: Apple Mail (2.3445.9.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On 25 Jul 2018, at 9:43, Nicola Contu wrote: >=20 > Hello, > we recently moved from postgres 9.6.6 to 10.4 >=20 > We perform a pg_dump in production to restore daily in a preprod env. > This process used to work perfectly, but now we have a tiny problem. >=20 > We first restore data, we perform a vacuum and then we restore = matviews. What are the commands you used? You don't seem to mention restoring the = schema? > Restoring matviews now we have : >=20 > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Error from TOC entry 23090; 0 1912379424 = MATERIALIZED VIEW DATA matview_vrs_request_sla postgres > pg_restore: [archiver (db)] could not execute query: ERROR: relation = "all_days" does not exist > LINE 3: from all_days > ^ > QUERY: > select count(*)::numeric > from all_days > where (("date" between $2::date and $1::date) or ("date" between = $1::date and $2::date)) > and dow not in (0,6) >=20 > CONTEXT: SQL function "bdays" during inlining > Command was: REFRESH MATERIALIZED VIEW = public.matview_vrs_request_sla; Is all_days a table? Or is it perhaps another view, possibly = materialized even? > The relation is there, in fact if I go there when I get in to the = office, the same command works. This sounds to me like you may be using a different version of = pg_restore in the office. Are both versions 10.4 or newer? It can't hurt to check that you used version 10.4 of pg_dump as well. Alban Hertroys -- If you can't see the forest for the trees, cut the trees and you'll find there is no forest.