Re: invalid memory alloc request size error with commit 4b93f579

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

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rushabh Lathia <rushabh.lathia@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-02-26T21:25:25Z
Lists: pgsql-hackers

Attachments

I wrote:
> I wonder whether it is worth creating a C trigger function
> (probably in regress.c) specifically to exercise this situation.

Actually, that doesn't seem too bad at all.  I propose applying
and back-patching the attached.

BTW, I noticed while doing this that the adjacent "funny_dup17"
trigger is dead code, and has been since commit 1547ee01 of
1999-09-29.  I'm inclined to rip it out, because anyone looking
at regress.c would naturally assume that anything in there is
being exercised.

			regards, tom lane

Commits

  1. Prevent dangling-pointer access when update trigger returns old tuple.

  2. Improve regression test coverage of regress.c.

  3. Remove unused functions in regress.c.

  4. Make plpgsql use its DTYPE_REC code paths for composite-type variables.

  5. This is part #1 for of the DEFERRED CONSTRAINT TRIGGER support.