PL Features Matrix

Goal of this page is to document the main features of a Procedural Language, and summarize which features each implemented language provides. 
== List of Features ==
* accepts named args
* returns arrays
* returns tables 
* has a validator function
* supports triggers
* variadic
** on TRUNCATE
** FOR EACH STATEMENT
* Trusted mode (security)
** Have a need for testers for trusted languages
** We probably will not accept additional languages in core, but we may get to the point where we stop allowing non-core trusted languages
** PL/Ruby - stuff you can turn on/off ? 
* DO block support (aka inline handlers)
* Composite type support
* Native types
** ENUMs - passing it too and from a language that does or doesn't support enums
** how does type mapping work in general?
* SPI interface documentation
** Cursor support
* Subtransactions
* Support for OUT arguments, how is it bound to the native language
* Sharing data / global hash to allow functions to share data :) (in the same PLs)
* Quoting functions (string escaping)
* AUTOLOAD support (TCL, Perl has it)
** Standardize where each PL does this (a table?)
== Wishlist / Alternative architectural discussions ==
* Getting functions to have introspection
* Ability to handle internal types: text search parsers, windowing functions, aggregate functions in PLs :), -- how to expose?, extend API in backend to allow this
* Foreign Data Wrappers
* Streaming SRFs (tuple store discussion)
* How to merge PL/PSM without having to duplicate 70% of the PL/pgsql code
* Top memory context vs caching of XYZ somewhere else
** output of a JIT stashed in memory 
** TODO: hook for a DROP FUNCTION to clean up the cache
** boilerplate in the PL code ? -->
*** PL handler: pass a pointer to a piece of memory so you can store whatever you want
*** PL handler: also keep track of lifecycle 
*** hash table support to stash the compiled version of the function
*** Tim wrote a NULL language: shell of a validator, executor
== TODO ==
* Publish code for PL/NULL - Tim
* Make a list of all the boilerplate code :) - Tim, Selena will send email to -hackers about it
* Set up a 1/2 day meeting at the next pgcon - Josh Berkus (?)
* Set up a Skype session in a few months time to go over progress - Selena (Tim, Alvaro agreed to attend)
* Further discussion of DDL triggers - Jan
* Further discussion of permission system - Steve
* Further discussion of per-statement config parameters for things like timezone - Jan
== PL interface improvements ==
* Can't write INPUT/OUTPUT functions in languages other than C
** PL handler needs to know that it is now an i/o function, and i just passed a DATUM through (usually get pointers to these)
** Most PLs wrap all the args in text (but not python for bytea)
** Peter -- SQL CREATE *something* standard - casts for type between PLs and SQL (?); e.g. hstores in PL/Python - create transforms for [type name]
** Tim does it with casts for functions
** email Dec 15 2011 
** http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.sql.ref.doc/doc/r0003292.html
** Pass arguments in their native format without going through i/o functions
** Profiling: a lot of time is spent in the pg i/o functions
== Matrix ==
See PL_Matrix
Category:Languages