Thread

  1. First feature patch for plperl - second draft [PATCH]

    Tim Bunce <tim.bunce@pobox.com> — 2009-12-21T21:55:44Z

    Building on my earlier plperl refactoring patch, and the follow-on
    ppport.h patch, here's a second draft of my first plperl feature patch.
    
    Significant changes in this patch:
    
    - New GUC plperl.on_perl_init='...perl...' for admin use.
    - New GUC plperl.on_trusted_init='...perl...' for plperl user use.
    - New GUC plperl.on_untrusted_init='...perl...' for plperlu user use.
    - END blocks now run at backend exit (fixes bug #5066).
    - Stored procedure subs are now given names ($name__$oid).
    - More error checking and reporting.
    - Warnings no longer have an extra newline in the NOTICE text.
    - Various minor optimizations like pre-growing data structures.
    
    Changes since first draft:
    - SPI functions aren't available during plperl.on_*_init execution.
    - Added utility functions: quote_literal, quote_nullable, quote_ident,
        encode_bytea, decode_bytea, looks_like_number,
        encode_array_literal, encode_array_constructor.
    - Enabled plperl to "use"/"require" safely by redirecting the require
        opcode to code that dies if module not already loaded.
    - Corresponding changes to the documentation.
    
    I believe this patch is done. I'm calling it draft to get some initial
    feedback before I submit it to the commitfest - just incase I've done
    anything particularly dumb.
    
    Tim.
    
    p.s. Once this patch is complete I plan to work on patches that:
    - generalize the Safe setup code to enable more control.
    - formalize namespace usage, moving more things out of main::
    - add a way to perform inter-sub calling (at least for simple cases).
    - improve performance (after some profiling).