Re: BUG #16266: Server crash on SELECT event_trigger-returning function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: exclusion(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16266: Server crash on SELECT event_trigger-returning function
Date: 2020-02-19 16:05:05
Message-ID: 19565.1582128305@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Juan José Santamaría Flecha 2020-02-19 16:16:32 Re: BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform
Previous Message Tom Lane 2020-02-19 15:44:49 Re: BUG #16265: psql shows (unfolded) relation name in quotes