Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4Rqb-0001d1-N1 for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Feb 2020 16:05:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j4Rqa-0002CE-D3 for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Feb 2020 16:05:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4Rqa-0002C6-4p for pgsql-bugs@lists.postgresql.org; Wed, 19 Feb 2020 16:05:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j4RqX-0007gE-DE for pgsql-bugs@lists.postgresql.org; Wed, 19 Feb 2020 16:05:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 01JG55Zk019566; Wed, 19 Feb 2020 11:05:05 -0500 From: Tom Lane To: exclusion@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16266: Server crash on SELECT event_trigger-returning function In-reply-to: <16266-fcd7f838e97ba5d4@postgresql.org> References: <16266-fcd7f838e97ba5d4@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 19 Feb 2020 08:00:01 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19564.1582128305.1@sss.pgh.pa.us> Date: Wed, 19 Feb 2020 11:05:05 -0500 Message-ID: <19565.1582128305@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form 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