Re: Fix PL/Python metadata when there is no result

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jean-Baptiste Quenot <jbq(at)caraldi(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fix PL/Python metadata when there is no result
Date: 2012-02-24 19:27:24
Message-ID: 1330111644.32452.20.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On fre, 2012-02-10 at 17:44 +0100, Jean-Baptiste Quenot wrote:
> Thanks for the work on PLPython result metadata, it is very useful! I
> just came across a crash when trying to access this metadata on the
> result of an UPDATE, which obviously cannot return any tuple (unless
> you specify a RETURNING clause maybe?).
>
> Please find attached a patch that solves this issue. Instead of a PG
> crash, we get the following message:
>
> ERROR: plpy.Error: no result fetched

Hmm, should it be an error or just return None? Python DB-API
cursor.description returns None if no result set was returned.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-02-24 19:27:36 Re: Triggers with DO functionality
Previous Message Peter Eisentraut 2012-02-24 19:23:23 Re: Triggers with DO functionality