Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZHVd-0004py-Os for pgsql-bugs@arkaria.postgresql.org; Thu, 14 May 2020 17:19:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jZHVb-0006Ih-8K for pgsql-bugs@arkaria.postgresql.org; Thu, 14 May 2020 17:18:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZHVb-0006Ia-0W for pgsql-bugs@lists.postgresql.org; Thu, 14 May 2020 17:18:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZHVV-0002JP-FF for pgsql-bugs@lists.postgresql.org; Thu, 14 May 2020 17:18: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 04EHIpWI006546; Thu, 14 May 2020 13:18:51 -0400 From: Tom Lane To: koktos632@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16437: The dump is stored with error in creating VIEW statement. In-reply-to: <16437-5257db04508943ab@postgresql.org> References: <16437-5257db04508943ab@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 14 May 2020 16:21:25 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6544.1589476731.1@sss.pgh.pa.us> Date: Thu, 14 May 2020 13:18:51 -0400 Message-ID: <6545.1589476731@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > pg_restore: creating VIEW "ctrader.sentiment_summary_600" > pg_restore: while PROCESSING TOC: > pg_restore: from TOC entry 252; 1259 25769 VIEW sentiment_summary_600 > quotefeeder > pg_restore: error: could not execute query: ERROR: column > "_materialized_hypertable_2.Volume" must appear in the GROUP BY clause or be > used in an aggregate function Hm. I suppose that this view is valid in the source database because "Time" and/or "m_tickerId" are the primary key of _materialized_hypertable_2, and the restore is failing because pg_dump didn't restore the primary key constraint first. But it should know to do that, and you haven't provided nearly enough information to track down why it didn't. Can you provide a self-contained test case that fails like this? We probably don't need to see any data, just the database object declarations. regards, tom lane