Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSe1x-0008Ez-Nd for pgsql-docs@arkaria.postgresql.org; Thu, 07 Nov 2019 09:24:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSe1w-0007x3-DM for pgsql-docs@arkaria.postgresql.org; Thu, 07 Nov 2019 09:24:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSe1w-0007ww-2h for pgsql-docs@lists.postgresql.org; Thu, 07 Nov 2019 09:24:40 +0000 Received: from forward104p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b7:107]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iSe1r-0000jX-9l for pgsql-docs@lists.postgresql.org; Thu, 07 Nov 2019 09:24:38 +0000 Received: from forward100q.mail.yandex.net (forward100q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb97]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 1C9F64B0120C; Thu, 7 Nov 2019 12:24:31 +0300 (MSK) Received: from mxback10q.mail.yandex.net (mxback10q.mail.yandex.net [IPv6:2a02:6b8:c0e:1b4:0:640:b6ef:cb3]) by forward100q.mail.yandex.net (Yandex) with ESMTP id 18AB27080005; Thu, 7 Nov 2019 12:24:31 +0300 (MSK) Received: from vla5-9cb0c276d29e.qloud-c.yandex.net (vla5-9cb0c276d29e.qloud-c.yandex.net [2a02:6b8:c18:3588:0:640:9cb0:c276]) by mxback10q.mail.yandex.net (mxback/Yandex) with ESMTP id jngDPeZIYX-OVrCBiZl; Thu, 07 Nov 2019 12:24:31 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1573118671; bh=6BeiQGNedE0jJXfxCQzDH3ILDGBydTcAyHMcBnmok3s=; h=In-Reply-To:Subject:CC:To:From:References:Date:Message-ID; b=RdFeyqDC1Bwp13DW+TCbhmuCSqnR3ug+3FHjsOKj1stpReJ3aY8Y4MyQ9vo5P8mSK cCyTuVnRO0MfogmjfaBzK5dY7adaqXRcQpLfgIsetsImji7a6TbkuQBu6heDJ1Kedp fJNoTf4VBAOi1zh0VhACc41i8sUsSXXsvVmPg6ng= Authentication-Results: mxback10q.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by vla5-9cb0c276d29e.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 8GXR1Ok5r3-OTUqFPOV; Thu, 07 Nov 2019 12:24:30 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) Date: Thu, 7 Nov 2019 11:24:29 +0200 From: Eugen Konkov Message-ID: <352093181.20191107112429@yandex.ru> To: Bruce Momjian CC: PostgreSQL-development , pgsql-docs@lists.postgresql.org Subject: Re: Does 'instead of delete' trigger support modification of OLD In-Reply-To: <1771593631.20191107112032@yandex.ru> References: <919823407.20191029175436@yandex.ru> <20191106185935.GE1843@momjian.us> <1771593631.20191107112032@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Eugen, Thursday, November 7, 2019, 11:20:32 AM, you wrote: >> I looked in the CREATE TRIGGER manual page and found this: >> https://www.postgresql.org/docs/12/sql-createtrigger.html >> If the trigger fires before or instead of the event, the trigger >> can skip the operation for the current row, or change the row >> being inserted (for INSERT and UPDATE operations only). >> I don't see the "(for INSERT and UPDATE operations only)" language in >> the main trigger documentation, >> https://www.postgresql.org/docs/current/trigger-definition.html. I have >> written the attached patch to fix that. Does that help? > No. If we document that PG does not allow to modify OLD at instead > of trigger, the we can not implement that. Probably we can put note > that "currently modification of the trigger row for RETURNING is not > implemented" sorry, typo. Please read: "currently modification of the trigger row for DELETE RETURNING is notimplemented" >> As far as allowing DELETE to modify the trigger row for RETURNING, I am >> not sure how much work it would take to allow that, but it seems like it >> is a valid requite, and if so, I can add it to the TODO list. > Yes, Add please into TODO the feature to "allowing DELETE to modify the trigger row > for RETURNING". Becuase, as I have described at first letter, without > this the RETURNING rows **does not correspond actually deleted data** > Thank you. -- Best regards, Eugen Konkov