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 1fiKmj-0004pK-Iw for pgsql-general@arkaria.postgresql.org; Wed, 25 Jul 2018 14: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 1fiKmh-0007O5-Iw for pgsql-general@arkaria.postgresql.org; Wed, 25 Jul 2018 14:28:59 +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 1fiKmh-0007Nx-3c for pgsql-general@lists.postgresql.org; Wed, 25 Jul 2018 14:28:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiKme-0003EJ-6E for pgsql-general@lists.postgresql.org; Wed, 25 Jul 2018 14:28:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w6PESjTn001736; Wed, 25 Jul 2018 10:28:45 -0400 From: Tom Lane To: Laurenz Albe cc: Nicola Contu , pgsql-general@lists.postgresql.org, Alessandro Aste Subject: Re: Restore from dumps In-reply-to: <1532513198.2489.1.camel@cybertec.at> References: <1532513198.2489.1.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Wed, 25 Jul 2018 12:06:38 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1734.1532528925.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 25 Jul 2018 10:28:45 -0400 Message-ID: <1735.1532528925@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Laurenz Albe writes: > Nicola Contu wrote: >> 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::da= te and $2::date)) >> and dow not in (0,6) >> = >> CONTEXT: SQL function "bdays" during inlining > Try to ALTER the materialized view so that it refers to "public.all_days= " > rather than "all_days". Per the error message, what needs fixing is the SQL function "bdays", not the matview as such. regards, tom lane