Re: [HACKERS] Consistently catch errors from Python _New() functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Consistently catch errors from Python _New() functions
Date: 2017-11-18 17:05:18
Message-ID: 26289.1511024718@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> On 11/17/17 12:16, Tom Lane wrote:
>> I'm confused by the places that change PLy_elog calls to pass NULL:
>>
>> - PLy_elog(ERROR, "could not create globals");
>> + PLy_elog(ERROR, NULL);
>>
>> How is that an improvement? Otherwise it looks reasonable.

> If we pass NULL, then the current Python exception becomes the primary
> error, so you'd end up with an "out of memory" error of some kind with a
> stack trace, which seems useful.

Oh, I see. Objection withdrawn.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-11-18 18:32:30 Re: [HACKERS] Add Roman numeral conversion to to_number
Previous Message Sophie Herold 2017-11-18 16:58:16 Re: to_typemod(type_name) information function