Re: pl/perl example in the doc no longer works in 9.1

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alex Hunsaker <badalex@gmail.com>
Cc: "David E. Wheeler" <david@kineticode.com>, Amit Khandekar <amit.khandekar@enterprisedb.com>, hackers@postgresql.org, Alvaro Herrera <alvherre@commandprompt.com>, Alexey Klyukin <alexk@commandprompt.com>
Date: 2011-10-13T22:05:45Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Convert Postgres arrays to Perl arrays on PL/perl input arguments

Alex Hunsaker <badalex@gmail.com> writes:
> This gets rid of of most of the if/else chain and the has_retval crap
> in plperl_handl_func(). Instead we let plperl_sv_to_datum() do most of
> the lifting. It also now handles VOIDOID and checks that the request
> result oid can be converted from the perl structure. For example if
> you passed in a hashref with a result oid that was not an rowtype it
> will error out with "PL/Perl cannot convert hash to non rowtype %s".
> Arrays behave similarly.

Applied with some further hacking of my own to clean up memory leaks
and grotty coding.

			regards, tom lane