Re: Completing PL support for Event Triggers - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Completing PL support for Event Triggers
Date
Msg-id 1385467181.13003.2.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: Completing PL support for Event Triggers  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: Completing PL support for Event Triggers  (Peter Eisentraut <peter_e@gmx.net>)
Re: Completing PL support for Event Triggers  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
I made one significant change in the PL/Perl patch. You had this in
plperl_event_trigger_handler():

+       /*
+        * Create the call_data before connecting to SPI, so that it is not
+        * allocated in the SPI memory context
+        */
+       current_call_data = (plperl_call_data *) palloc0(sizeof(plperl_call_data));
+       current_call_data->fcinfo = fcinfo;

I think this is wrong, and the reason it crashes if you remove it is
that you need to call increment_prodesc_refcount(prodesc), like in the
other handlers.

Attached is my "final" patch.  Let me know if it's OK for you.


Attachment

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Get more from indices.
Next
From: Rajeev rastogi
Date:
Subject: Re: TODO: Split out pg_resetxlog output into pre- and post-sections