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-17 17:16:40
Message-ID: 9477.1510939000@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:
> While reviewing some unrelated code, I noticed that we are handling
> error conditions from Python API functions such as PyList_New() and
> PyDict_New() in pretty random ways or not at all. Here is a patch to
> fix that.

This needs some adjustment in the wake of 687f096ea.

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2017-11-17 17:57:23 Re: Speed up the removal of WAL files
Previous Message Tom Lane 2017-11-17 17:05:46 Re: Fix number skipping in to_number