Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxw8I-0005uv-VM for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Apr 2017 13:46:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cxw8I-0003a0-IR for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Apr 2017 13:46:58 +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.84_2) (envelope-from ) id 1cxw6m-00070x-Cd for pgsql-hackers@postgresql.org; Tue, 11 Apr 2017 13:45:24 +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.84_2) (envelope-from ) id 1cxw6X-00039h-Er for pgsql-hackers@postgresql.org; Tue, 11 Apr 2017 13:45:23 +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 v3BDj00N028524; Tue, 11 Apr 2017 09:45:00 -0400 From: Tom Lane To: Amit Langote cc: Robert Haas , Kyotaro HORIGUCHI , Amit Langote , Maksim Milyutin , "pgsql-hackers@postgresql.org" Subject: Re: Partitioned tables and relfilenode In-reply-to: <062ab583-767d-9d08-5c7c-16b674a4c279@lab.ntt.co.jp> References: <20170331.155028.28878375.horiguchi.kyotaro@lab.ntt.co.jp> <2dec1acb-6e2f-5aa5-0e26-fcc172ce9359@lab.ntt.co.jp> <20170331.173326.212311140.horiguchi.kyotaro@lab.ntt.co.jp> <07595d66-bab8-2e24-438e-bacd20df52b5@lab.ntt.co.jp> <062ab583-767d-9d08-5c7c-16b674a4c279@lab.ntt.co.jp> Comments: In-reply-to Amit Langote message dated "Tue, 11 Apr 2017 18:16:51 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28522.1491918300.1@sss.pgh.pa.us> Date: Tue, 11 Apr 2017 09:45:00 -0400 Message-ID: <28523.1491918300@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-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Amit Langote writes: > 2. DefineQueryRewrite() may try to scan a partitioned table in the case of > converting a table to view, where we must make sure that the table being > converted is empty. It's checked by scanning the heap, which we should > not do for a partitioned table. Nor should we try to drop the storage > once ready to make the table into a REKIND_VIEW relation (because all > other checks passed okaying the conversion). It looks like this patch intends to allow converting a partitioned table to a view. I would lobby for refusing the command, instead. There is no good reason to allow it, and it might well be a user error. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers