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 1iSdzw-0008AV-2d for pgsql-docs@arkaria.postgresql.org; Thu, 07 Nov 2019 09:22:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSdzu-0005GM-Mf for pgsql-docs@arkaria.postgresql.org; Thu, 07 Nov 2019 09:22:34 +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 1iSdy7-0001l9-NL for pgsql-docs@lists.postgresql.org; Thu, 07 Nov 2019 09:20:43 +0000 Received: from forward105p.mail.yandex.net ([77.88.28.108]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iSdy2-0000hg-V6 for pgsql-docs@lists.postgresql.org; Thu, 07 Nov 2019 09:20:42 +0000 Received: from mxback25o.mail.yandex.net (mxback25o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::76]) by forward105p.mail.yandex.net (Yandex) with ESMTP id D78A94D4122F; Thu, 7 Nov 2019 12:20:35 +0300 (MSK) Received: from sas1-37f8c954267c.qloud-c.yandex.net (sas1-37f8c954267c.qloud-c.yandex.net [2a02:6b8:c08:1d1d:0:640:37f8:c954]) by mxback25o.mail.yandex.net (mxback/Yandex) with ESMTP id CtFVWoOM6q-KZDWuHZ1; Thu, 07 Nov 2019 12:20:35 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1573118435; bh=E0aFrqJbZJ7zXCPQjcMv5HN7NCaYDpxepjdQ+Vcqpxk=; h=In-Reply-To:Subject:CC:To:From:References:Date:Message-ID; b=serlM2iuQjFm8lszratRzn/79B/tWjHIMgtR3JRqo9IbBbqs/ThQLXCv8rvyBc3ey OMJK+BsxFvU+A3D2xVFTLORMwpYso2PF3f/w3u1+4pLapKM23BmNLwb/NnJjhP0uYY olfqTCDaubbR6T03liViPzxg47/v2mXNc9XuQRzk= Authentication-Results: mxback25o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by sas1-37f8c954267c.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 867rEYsq6P-KXVCXNt0; Thu, 07 Nov 2019 12:20:34 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) Date: Thu, 7 Nov 2019 11:20:32 +0200 From: Eugen Konkov Message-ID: <1771593631.20191107112032@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: <20191106185935.GE1843@momjian.us> References: <919823407.20191029175436@yandex.ru> <20191106185935.GE1843@momjian.us> 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 > 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" > 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