Re: BUG #16266: Server crash on SELECT event_trigger-returning function
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Date: 2020-02-19T16:05:05Z
Lists: pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes: > The following query: > CREATE OR REPLACE FUNCTION et() RETURNS event_trigger > LANGUAGE plpgsql AS $$ > BEGIN > END; > $$; > SELECT et(); > leads to a server crash with the following stack trace: Yeah. If you didn't just validate the function, it does the expected thing: regression=# SELECT et(); ERROR: trigger functions can only be called as triggers CONTEXT: compilation of PL/pgSQL function "et" near line 1 I think perhaps the problem is that compute_function_hashkey hasn't been fixed to deal with event triggers sanely. They need to not have the same hash keys as ordinary function calls. regards, tom lane
Commits
-
Fix confusion about event trigger vs. plain function in plpgsql.
- 761a5688b179 13.0 landed
- bbefb1154189 9.5.22 landed
- 6af63cf8c0b9 10.13 landed
- 612d207bcc05 11.8 landed
- 3e5308969aca 9.6.18 landed
- 32aa14d40c7c 12.3 landed