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 1ogRS4-0005J9-TG for pgsql-general@arkaria.postgresql.org; Thu, 06 Oct 2022 14:02:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ogRS3-0007wb-4n for pgsql-general@arkaria.postgresql.org; Thu, 06 Oct 2022 14:02:15 +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 1ogRS2-0007u5-QO for pgsql-general@lists.postgresql.org; Thu, 06 Oct 2022 14:02:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogRS0-0002zY-Ft for pgsql-general@postgresql.org; Thu, 06 Oct 2022 14:02:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 296E2ANa2662606; Thu, 6 Oct 2022 10:02:10 -0400 From: Tom Lane To: Kouber Saparev cc: pgsql-general@postgresql.org Subject: Re: Cannot convert partitioned table to a view In-reply-to: References: Comments: In-reply-to Kouber Saparev message dated "Thu, 06 Oct 2022 15:26:33 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2662604.1665064930.1@sss.pgh.pa.us> Date: Thu, 06 Oct 2022 10:02:10 -0400 Message-ID: <2662605.1665064930@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Kouber Saparev writes: > I noticed that attaching the "_RETURN" rule to a table converts it to a > view, and the operation is irreversible, i.e. once attached, I cannot drop > the rule and put the relation back to a table one. That is an ancient backwards-compatibility hack that you should not rely on, and most certainly shouldn't try to make use of from user code. It exists because very ancient versions of pg_dump didn't know how to dump views as views. We're more likely to rip it out as no-longer-needed than to expand what it does. regards, tom lane