Re: BUG #16644: null value for defaults in OLD variable for trigger

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Langote <amitlangote09@gmail.com>
Cc: fedor_erastov@mail.ru, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>, Andres Freund <andres@anarazel.de>, Andrew Dunstan <andrew@dunslane.net>
Date: 2020-10-25T17:59:30Z
Lists: pgsql-bugs
I wrote:
> Amit Langote <amitlangote09@gmail.com> writes:
>> Maybe something like the attached?

> Probably needs some attention to memory management (e.g.,
> should_free_trig) but I'm okay with doing this as a short-term
> fix.

I fixed the should_free business, and spent a fair amount of time
convincing myself that no other code paths in trigger.c need this,
and pushed it.

			regards, tom lane



Commits

  1. In INSERT/UPDATE, use the table's real tuple descriptor as target.

  2. Fix corner case for a BEFORE ROW UPDATE trigger returning OLD.

  3. Use slots in trigger infrastructure, except for the actual invocation.