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 1lUDiR-0006QW-AI for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Apr 2021 19:19:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lUDiQ-0005Xu-7M for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Apr 2021 19:19:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUDiQ-0005Xm-0P for pgsql-hackers@lists.postgresql.org; Wed, 07 Apr 2021 19:19:50 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUDiJ-00056e-FI for pgsql-hackers@lists.postgresql.org; Wed, 07 Apr 2021 19:19:49 +0000 Received: from hnk.local (p2350207-ipbf2126funabasi.chiba.ocn.ne.jp [114.167.184.207]) by oss.nttdata.com (Postfix) with ESMTPSA id 3328C627CE; Thu, 8 Apr 2021 04:19:38 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: TRUNCATE on foreign table To: Kazutaka Onishi , Bharath Rupireddy Cc: Kohei KaiGai , Zhihong Yu , Amit Langote , Ibrar Ahmed , PostgreSQL Developers , Ashutosh Bapat References: From: Fujii Masao Message-ID: Date: Thu, 8 Apr 2021 04:19:37 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/04/06 21:06, Kazutaka Onishi wrote: > Thank you for checking v13, and here is v14 patch. > >> 1) Are we using all of these macros? I see that we are setting them >> but we only use TRUNCATE_REL_CONTEXT_ONLY. If not used, can we remove >> them? > > These may be needed for the foreign data handler other than postgres_fdw. Could you tell me how such FDWs use TRUNCATE_REL_CONTEXT_CASCADING and _NORMAL? I'm still not sure if TRUNCATE_REL_CONTEXT_CASCADING is really required. With the patch, both inherited and referencing relations are marked as TRUNCATE_REL_CONTEXT_CASCADING? Is this ok for that use? Or we should distinguish them? +#define TRUNCATE_REL_CONTEXT_NORMAL 0x01 +#define TRUNCATE_REL_CONTEXT_ONLY 0x02 +#define TRUNCATE_REL_CONTEXT_CASCADING 0x04 With the patch, these are defined as flag bits. But ExecuteTruncate() seems to always set the entry in relids_extra to either of them, not the combination of them. So we can define them as enum? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION