Re: [HACKERS] statement level trigger causes pltcl, plpython SIGSEGV

From: Joe Conway <mail(at)joeconway(dot)com>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] statement level trigger causes pltcl, plpython SIGSEGV
Date: 2003-08-04 05:45:06
Message-ID: 3F2DF2E2.3030107@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Joe Conway wrote:
> I'll try to submit a patch later tonight or tomorrow morning if no one
> beats me to it.
>

Here's a patch for pltcl. It works for my test case:

CREATE OR REPLACE FUNCTION footrigfunc() RETURNS trigger AS 'return OK'
LANGUAGE pltcl;
CREATE TRIGGER footrig BEFORE INSERT OR UPDATE OR DELETE ON foo FOR EACH
STATEMENT EXECUTE PROCEDURE footrigfunc();
insert into foo values(11,'cat99',1.89);
delete from foo where f0 = 11;

I also ran the "runtest" script in pl/tcl/test -- it said:
**** Running test queries ****
Tests passed O.K.

Note that I also changed behavior in that when trigdata->tg_event
doesn't match anything known -- instead of pressing on with a value of
"UNKNOWN" it now throws an "elog(ERROR...". The previous behavior made
no sense to me, but you may not want to change existing behavior in this
way (even though it seems to me that it is a "should not happen" kind of
error).

If this patch is acceptable, I'll make similar changes to plpython. If
not, let me know what to change.

Thanks,

Joe

Attachment Content-Type Size
pltcl-statement-trig-fix.1.patch text/plain 4.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-08-04 05:48:28 Re: Release changes
Previous Message Dennis Björklund 2003-08-04 05:44:37 Re: concat_ws

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2003-08-04 08:09:47 Re: statement level trigger causes pltcl,
Previous Message elein 2003-08-04 04:59:38 Re: statement level trigger causes pltcl, plpython SIGSEGV