Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZHr5F-0004CO-Nk for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Jul 2015 10:17:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZHr5F-0001sv-8O for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Jul 2015 10:17:05 +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) (envelope-from ) id 1ZHr4d-00019t-7d for pgsql-bugs@postgresql.org; Wed, 22 Jul 2015 10:16:27 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZHr4a-0001di-9S for pgsql-bugs@postgresql.org; Wed, 22 Jul 2015 10:16:26 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 9B134860003; Wed, 22 Jul 2015 12:16:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p5DDC6ED2.dip0.t-ipconnect.de [93.220.110.210]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id C0416860002; Wed, 22 Jul 2015 12:16:19 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 4F48B100C3E; Wed, 22 Jul 2015 12:16:19 +0200 (CEST) Date: Wed, 22 Jul 2015 12:16:19 +0200 From: Andres Freund To: Piergiorgio Buongiovanni Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13513: Turning a table into a view Message-ID: <20150722101619.GF5053@awork2.anarazel.de> References: <20150722082538.9705.21746@wrigleys.postgresql.org> <20150722085906.GE5053@awork2.anarazel.de> <416591758.338151.1437558796979.JavaMail.zimbra@net-international.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <416591758.338151.1437558796979.JavaMail.zimbra@net-international.com> X-Pg-Spam-Score: -5.4 (-----) 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 Hi, On 2015-07-22 11:53:16 +0200, Piergiorgio Buongiovanni wrote: > Just only to answer to your question, we are doing some tests with our > RAD (Instant Developer) and we are trying to "cheating" it. Hah. > PostgreSQL is very powerful allowing us to use views as tables through the RULE mechanism. > Well. Our RAD doesn't treat views as tables (probably the problem is the JDBC driver) and we cannot insert data into a view. > So we create a table, then we import that table into the project and the RAD reads all the info (constraints, default values, etc.) and creates the fields correctly. > At the end we turn the table into a view simply using rules. You can probably work around the problem by inserting a VACUUM tbl_becoming_view; before the CREATE RULE. IIRC that should "recompute" relhastriggers. Regards, Andres -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs