Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dDYOk-0000fz-3w for pgsql-bugs@arkaria.postgresql.org; Wed, 24 May 2017 15:40:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dDYOj-00033N-II for pgsql-bugs@arkaria.postgresql.org; Wed, 24 May 2017 15:40:29 +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.84_2) (envelope-from ) id 1dDYO1-0000XL-22 for pgsql-bugs@postgresql.org; Wed, 24 May 2017 15:39:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dDYNy-0000Z4-De for pgsql-bugs@postgresql.org; Wed, 24 May 2017 15:39:44 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v4OFdc5H017965; Wed, 24 May 2017 11:39:38 -0400 From: Tom Lane To: Florian Gossin cc: pgsql-bugs@postgresql.org Subject: Re: Can't restore view with pg_restore In-reply-to: References: Comments: In-reply-to Florian Gossin message dated "Wed, 24 May 2017 16:18:12 +0200" Date: Wed, 24 May 2017 11:39:38 -0400 Message-ID: <2329.1495640378@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Florian Gossin writes: > I'm doing a dump in directory format of database with several schemas using > pg_dump and when I try to restore it using pg_restore, I get the following > error: > ERROR: could not convert table "bmv_visits_list" to a view because it has > triggers > STATEMENT: CREATE RULE "_RETURN" AS > ON SELECT TO bmv_visits_list DO INSTEAD SELECT patient.firstname, Hm, seems like pg_dump is trying to dump the various bits of the view in the wrong order. But since we haven't seen reports of this before, there must be something odd about your schema to trigger it. Can you do a plain "pg_dump -s" and show us the parts relating to this view and its underlying tables? regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs