Re: pgsql: Fix breakage from earlier plperl fix.

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

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alex Hunsaker <badalex@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>, pgsql-committers@postgresql.org
Date: 2012-01-06T07:26:07Z
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. Fix breakage from earlier plperl fix.

Alex Hunsaker <badalex@gmail.com> writes:
> PFA that copies if its readonly and its not a scalar. Also I fixed up
> Tom's complaint about having sv2cstr() inside do_util_elog's PG_TRY
> block.

On reflection I don't believe that just moving that call will improve
matters.  sv2cstr also contains a palloc, and if that throws an error,
it had better do so within a PG error context not the Perl one.

Making things safer will most likely require refactoring sv2cstr to
keep the Perl and PG operations entirely separate.

			regards, tom lane