public inbox for [email protected]
help / color / mirror / Atom feedFrom: Eugen Konkov <[email protected]>
To: Bruce Momjian <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Cc: [email protected]
Subject: Re: Does 'instead of delete' trigger support modification of OLD
Date: Fri, 17 Jan 2020 12:14:03 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Hello Bruce,
> Triggers are designed to check and modify input data, and since DELETE
> has no input data, it makes no sense.
Sorry, I am still ambiguous. You say that DELETE has no input data,
but doc says that it has:
https://www.postgresql.org/docs/current/trigger-definition.html
For a row-level trigger, the input data also includes ... the OLD row for ... DELETE triggers
Also restricting DELETE to change the returned data by DELETE
RETURNING seems as incomplete.
For example if triggers implement some compression.
-- insert into field ZZZZZ value
-- compress and actually store Zx5 into field
-- Delete this insert row
-- So user should get back that the value ZZZZZ was deleted and not Zx5.
Correct?
but currently user will see Zx5, because next code:
OLD.value = uncompress( OLD.value );
does not effect RETURNING =(
--
Best regards,
Eugen Konkov
view thread (13+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Does 'instead of delete' trigger support modification of OLD
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox