Re: pl/python tracebacks

From: Jan Urbański <wulczer(at)wulczer(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pl/python tracebacks
Date: 2011-03-01 19:20:58
Message-ID: 4D6D471A.8030108@wulczer.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/03/11 20:15, Tom Lane wrote:
> =?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= <wulczer(at)wulczer(dot)org> writes:
>> After thinking about it more I believe that the context field should
>> keep on being a one line indication of which function the message comes
>> from (and that's how it's done in PL/pgSQL for instance), and the detail
>> field should be used for the details of the message, like the traceback
>> that comes with it, and that's what the attached patch does.
>
> To me, none of those arguments seem good. Traceback is the sort of
> thing that belongs in errcontext, and arbitarily deciding that plpython
> isn't going to play by the rules doesn't sit well here. I agree that
> what you are showing is redundant with the current errcontext printout,
> but the solution for that is to change the errcontext printout, not to
> add redundant and inappropriate errdetail.
>
> An example of the reasoning for this is the situation where a plpython
> function calls back into SQL, and something there throws an ereport
> (which might include an errdetail). It would be useful to include the
> Python traceback in the errcontext stack, since there might be multiple
> levels of Python function call within what PG sees as just a "plpython
> function". But you can't get there with this approach.

Currently the traceback is added to the detail and the original
errdetail is preserved. So you'd get the detail line and the traceback
below it.

But OK, since there are more voices in favour of putting tracebacks in
the context field, I'll keep on looking for a solution.

Jan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-03-01 19:24:16 Re: Native XML
Previous Message Tom Lane 2011-03-01 19:15:41 Re: pl/python tracebacks