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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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 Content-Type Size
pg-plpy-result-str.patch text/x-patch 3.4 KB

Responses

Browse pgsql-hackers by date

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