Add on_trusted_init and on_untrusted_init to plperl UPDATED [PATCH]

Tim Bunce <tim.bunce@pobox.com>

From: Tim Bunce <Tim.Bunce@pobox.com>
To: pgsql-hackers@postgresql.org
Cc: Tim Bunce <Tim.Bunce@pobox.com>
Date: 2010-01-30T15:49:43Z
Lists: pgsql-hackers

Attachments

This is an update the fourth of the patches to be split out from the
former 'plperl feature patch 1'.

Changes in this patch:

- Adds plperl.on_trusted_init and plperl.on_untrusted_init GUCs
    on_trusted_init is PGC_USERSET, on_untrusted_init is PGC_SUSET
    SPI functions are not available when the code is run.
    Errors are detected and reported as ereport(ERROR, ...)
    Corresponding documentation.

- select_perl_context() state management improved
    An error during interpreter initialization will leave
    the state (interp_state etc) unchanged.

- The utf8fix code has been greatly simplified.

Tim.