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, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Fix PL/Python metadata when there is no result
Date: 2012-04-07 17:27:12
Message-ID: 1333819632.26334.8.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On tor, 2012-04-05 at 19:49 +0200, Jean-Baptiste Quenot wrote:
> I consider that this is an error to request metadata when the query does
> not return some. For example: "UPDATE mytable SET value = 1" does not
> return column metadata, so user is not supposed to col coltypes(). That's
> why I propose to return an error. coltypes() is supposed to return a
> sequence, not None. Checking for None is a bad coding practise IMO,
> especially when dealing with lists.

What would you suggest instead then?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2012-04-07 20:19:21 Re: pgsql_fdw, FDW for PostgreSQL server
Previous Message Noah Misch 2012-04-07 15:50:42 Re: ECPG FETCH readahead