PL/Python result object str handler - Mailing list pgsql-hackers

From Peter Eisentraut
Subject PL/Python result object str handler
Date
Msg-id 1357613925.19347.3.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: PL/Python result object str handler
Re: PL/Python result object str handler
List 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

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: lazy_vacuum_heap()'s removal of HEAPTUPLE_DEAD tuples
Next
From: Peter Eisentraut
Date:
Subject: Re: bad examples in pg_dump README