First feature patch for plperl - second draft [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: First feature patch for plperl - second draft [PATCH]
Date: 2009-12-21 21:55:44
Message-ID: 20091221215544.GH15262@timac.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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).

Attachment Content-Type Size
master-a3-plperl-feature3.patch text/x-patch 70.6 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2009-12-21 21:58:34 Re: Possible patch for better index name choosing
Previous Message Tim Bunce 2009-12-21 21:19:12 Update ppport.h in plperl