Re: plperl and inline functions -- first draft - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: plperl and inline functions -- first draft
Date
Msg-id 4B036E17.1060402@dunslane.net
Whole thread Raw
In response to Re: plperl and inline functions -- first draft  (Joshua Tolley <eggyknap@gmail.com>)
Responses Re: plperl and inline functions -- first draft
List pgsql-hackers

Joshua Tolley wrote:
> +     plperl_call_data *save_call_data = current_call_data;
> +     bool        oldcontext = trusted_context;
> + 
> +     if (SPI_connect() != SPI_OK_CONNECT)
> +         elog(ERROR, "could not connect to SPI manager");
>   
...
> +     current_call_data = (plperl_call_data *) palloc0(sizeof(plperl_call_data));
> +     current_call_data->fcinfo = &fake_fcinfo;
> +     current_call_data->prodesc = &desc;    
>   

I don't think this is done in the right order. If it is then this 
comment in plperl_func_handler is wrong (as well as containing a typo):
   /*    * Create the call_data beforing connecting to SPI, so that it is not    * allocated in the SPI memory context
 */
 


cheers

andrew


pgsql-hackers by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: magic block in doc functions
Next
From: Tom Lane
Date:
Subject: Re: Very bad FTS performance with the Polish config