Re: plpython triggers are broken for composite-type columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Urbański <wulczer(at)wulczer(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: plpython triggers are broken for composite-type columns
Date: 2012-04-10 18:47:27
Message-ID: 13362.1334083647@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> =?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= <wulczer(at)wulczer(dot)org> writes:
>> Now that I understand what's been going on, I'll try to think of a
>> non-invasive way of fixing that...

> ISTM that conversion of a composite value to Python ought to produce a
> dict, now that the other direction expects a dict. I can see that this
> is probably infeasible for compatibility reasons in 9.1, but it's not
> too late to fix it for 9.2. We might have to leave the bug unfixed in
> 9.1, since anything we do about it will represent a compatibility break.

On reflection, can't we fix this as follows: if the value coming in from
Python is a string, just feed it to record_in, the same as we used to.
When I traced through the logic before, it seemed like it was failing
to distinguish strings from sequences, but I would hope that Python
is more strongly typed than that.

I still think the conversion in the other direction ought to yield a
dict, but that's clearly not back-patch material.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2012-04-10 18:49:10 Re: Last gasp
Previous Message Tom Lane 2012-04-10 18:35:44 Re: plpython triggers are broken for composite-type columns