Skip site navigation (1) Skip section navigation (2)

Package namespace and Safe init cleanup for plperl UPDATE 3 [PATCH]

From: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
Subject: Package namespace and Safe init cleanup for plperl UPDATE 3 [PATCH]
Date: 2010-01-30 23:16:08
Message-ID: 20100130231608.GI1141@timac.local (view raw or flat)
Thread:
Lists: pgsql-hackers
This is an update to the final plperl patch in the series from me.

Changes in the original patch:

- Moved internal functions out of main:: namespace
    into PostgreSQL::InServer and PostgreSQL::InServer::safe

- Restructured Safe compartment setup code
    to generalize and separate the data from the logic.

Neither change has any user visible effects.

Additional changes in the second version:

- Further generalized the 'what to load into Safe compartment' logic.

- Added the 'warnings' pragma to the list of modules to load into Safe.
  So plperl functions can now "use warnings;" - added test for that.

- Added 'use 5.008001;' to plc_perlboot.pl as a run-time check to
  complement the configure-time check added by Tom Lane recently.

Additional changes in this version:

- Rebased over recent HEAD plus "on_trusted_init" patch

- Made plc_safe_ok.pl code idempotent to avoid risk of problems
  from repeated initialization attempts e.g. if on_trusted_init code
  throws an exception so initialization doesn't complete.

- Fixed 'require strict' to enable 'caller' opcode
  (needed for Perl >=5.10)

- Ensure Safe container opmask is restored even if @EvalInSafe code
  throws an exception.

- Changed errmsg("didn't get a GLOB ...") to use errmsg_internal().

Tim.

Attachment: plperl-nscleanup3.patch
Description: text/x-patch (9.9 KB)

Responses

pgsql-hackers by date

Next:From: Greg SmithDate: 2010-01-30 23:28:06
Subject: Re: development setup and libdir
Previous:From: Ivan Sergio BorgonovoDate: 2010-01-30 22:36:36
Subject: Re: development setup and libdir

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group