Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAdS2-0007h6-2p for pgsql-hackers@arkaria.postgresql.org; Tue, 16 May 2017 14:27:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dAdS1-0007xP-E6 for pgsql-hackers@arkaria.postgresql.org; Tue, 16 May 2017 14:27:49 +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 1dAdRz-0007uz-CZ for pgsql-hackers@postgresql.org; Tue, 16 May 2017 14:27:47 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAdRw-0000ie-6D for pgsql-hackers@postgresql.org; Tue, 16 May 2017 14:27:46 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id B8BDD21C0924; Tue, 16 May 2017 17:27:40 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Date: Tue, 16 May 2017 17:26:00 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1494944860; bh=gAuhXhT2bqwQPTrx+10pxiTze9nwTJ3ZYCjtLIS9cIA=; h=From:To:Cc:Subject:In-Reply-To:References; b=Lf1FLVtqVF3yYpoTW9dp1+CjEwhnccUA1eDbmzaKyyGm/F8HCwTAxgDFqUk2T1Ch0 YOug0G2r+lDydBSNfq35DiZBjLlL5+wRmf8oQ2sxloNi4htwbt6gaFw03RDfQIPzYA BupBMJ3oCfNNaRKo58syUuGbHUY45tk5vgwoK7fo= From: Ildus Kurbangaliev To: Etsuro Fujita Cc: Ashutosh Bapat , Dilip Kumar , PostgreSQL Hackers Subject: Re: Bug in ExecModifyTable function and trigger issues for foreign tables Message-ID: <20170516172600.291220dc@wp.localdomain> In-Reply-To: References: <20170514150525.0346ba72@postgrespro.ru> <20170515121638.0c076bcc@wp.localdomain> <20170515165455.545dd3d6@wp.localdomain> <20170516150516.1b616230@wp.localdomain> Organization: Postgres Professional X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) 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 On Tue, 16 May 2017 21:36:11 +0900 Etsuro Fujita wrote: > On 2017/05/16 21:11, Ashutosh Bapat wrote: > > On Tue, May 16, 2017 at 5:35 PM, Ildus Kurbangaliev > > wrote: > > >> I agree. Maybe this issue should be added to Postgresql Open Items? > >> I think there should be some complex solution that fixes not only > >> triggers for foreign tables at table partitioning, but covers other > >> possible not working cases. > > > I doubt if this is an open item, since DMLs on foreign tables are > > supported since 9.3 and support to add foreign tables to inheritance > > was added back in 9.5. > > I think this issue was introduced by the latter, so that was my fault. > > One approach I came up with to fix this issue is to rewrite the > targetList entries of an inherited UPDATE/DELETE properly using > rewriteTargetListUD, when generating a plan for each child table in > inheritance_planner. Attached is a WIP patch for that. Maybe I am > missing something, though. > > Best regards, > Etsuro Fujita I tested the patch, looks good. -- --- Ildus Kurbangaliev Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers