Skip site navigation (1) Skip section navigation (2)

PL/Python result object str handler

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PL/Python result object str handler
Date: 2013-01-08 02:58:45
Message-ID: 1357613925.19347.3.camel@vanquo.pezone.net (view raw or flat)
Thread:
Lists: pgsql-hackers
For debugging PL/Python functions, I'm often tempted to write something
like

rv = plpy.execute(...)
plpy.info(rv)

which prints something unhelpful like

<PLyResult object at 0xb461d8d8>

By implementing a "str" handler for the result object, it now prints
something like

<PLyResult status=5 nrows=2 rows=[{'foo': 1, 'bar': '11'}, {'foo': 2, 'bar': '22'}]>

Patch attached for review.


Attachment: pg-plpy-result-str.patch
Description: text/x-patch (3.4 KB)

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2013-01-08 03:12:22
Subject: Re: bad examples in pg_dump README
Previous:From: Noah MischDate: 2013-01-08 02:49:57
Subject: lazy_vacuum_heap()'s removal of HEAPTUPLE_DEAD tuples

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group