<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Postgres OnLine Journal - plperl</title>
    <link>http://www.postgresonline.com/journal/</link>
    <description>an In depth look at the PostgreSQL open source database</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.4.1 - http://www.s9y.org/</generator>
    <pubDate>Tue, 13 May 2008 23:53:20 GMT</pubDate>

    <image>
        <url>http://www.postgresonline.com/journal/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Postgres OnLine Journal - plperl - an In depth look at the PostgreSQL open source database</title>
        <link>http://www.postgresonline.com/journal/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Choosing the right Database Procedural Language PL</title>
    <link>http://www.postgresonline.com/journal/archives/50-Choosing-the-right-Database-Procedural-Language-PL.html</link>
            <category>beginner</category>
            <category>mysql</category>
            <category>pl programming</category>
            <category>plperl</category>
            <category>plpgsql</category>
            <category>PLR</category>
            <category>sql functions</category>
            <category>sql server</category>
    
    <comments>http://www.postgresonline.com/journal/archives/50-Choosing-the-right-Database-Procedural-Language-PL.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=50</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://www.postgresonline.com/journal/rss.php?version=2.0&amp;type=comments&amp;cid=50</wfw:commentRss>
    

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;P&gt;One of the great selling points of PostgreSQL is its pluggable PL language architecture.  MySQL is known for its pluggable storage and 
PostgreSQL is known for its pluggable PL language architecture.  From &lt;a href=&quot;http://www.scribd.com/doc/2575733/The-future-of-MySQL-The-Project&quot; target=_blank&gt;Monty&#039;s notes on slide 12&lt;/a&gt; looks like MySQL 
may be working on a pluggable PL language architecture of their own.
The most common of these languages are the all-purpose languages SQL and C (these are built-in and not really PLs like the others, but we&#039;ll throw them in there),
&lt;a href=&quot;http://www.postgresql.com.cn/docs/8.3/static/plpgsql.html&quot; target=_blank&gt;PLPgSQL&lt;/a&gt; which is also built-in but not always enabled, &lt;a href=&quot;http://www.postgresql.org/docs/8.3/static/plperl.html&quot; target=_blank&gt;PL/Perl&lt;/a&gt;, &lt;a href=&quot;http://www.postgresql.org/docs/8.3/interactive/plpython.html&quot; target=_blank&gt;PL/Python&lt;/a&gt;, and the domain specific languages &lt;a href=&quot;http://joeconway.com/plr/doc/index.html&quot; target=_blank&gt;PL/R&lt;/a&gt;, &lt;A href=&quot;http://plsh.projects.postgresql.org/&quot; target=_blank&gt;PL/SH&lt;/A&gt; and gaining popularity Skype released &lt;a href=&quot;https://developer.skype.com/SkypeGarage/DbProjects/PlProxy&quot; target=_blank&gt;PL/Proxy&lt;/a&gt;.  
There are others in the family such as &lt;a href=&quot;http://www.postgresql.org/docs/8.3/interactive/pltcl.html&quot; target=_blank&gt;PL/Tcl&lt;/a&gt;, &lt;a href=&quot;https://projects.commandprompt.com/public/plphp&quot; target=_blank&gt;PL/PHP&lt;/a&gt;, &lt;a href=&quot;http://raa.ruby-lang.org/project/pl-ruby/&quot; target=_blank&gt;PL/Ruby&lt;/a&gt;, &lt;a href=&quot;http://plscheme.projects.postgresql.org/&quot; target=_blank&gt;PL/Scheme (a dialect of Lisp)&lt;/a&gt;, &lt;a href=&quot;http://wiki.tada.se/display/pljava/Home&quot; target=_blank&gt;PL/Java&lt;/a&gt;, &lt;a href=&quot;http://pllua.projects.postgresql.org/&quot; target=_blank&gt;PL/Lua&lt;/a&gt; and &lt;a href=&quot;http://pgfoundry.org/projects/pllolcode&quot; target=_blank&gt;PL/LOLCode (for kicks and as a reference implementation.  Think of LOLCode as PostgreSQL Pluggable PL equivalent of MySQL&#039;s BLACK HOLE storage engine.)&lt;/a&gt; .
&lt;/P&gt;

&lt;P&gt;The other interesting thing about the PostgreSQL PL language architecture is that it is a fairly thin wrapper around these languages.
This means the kind of code you write in those languages is pretty much what you would write if you were doing general programming
in those languages minus some spi calls. Since the handler is a just a thin wrapper around the environment, the language environment must be installed on the database server before you can use the PL language handler.  This means you can have these functions utilized in your SQL statements and you can write
in a language you feel comfortable with if you can get the darn PL compiled for your environment or someone has already kindly compiled it for your environment or that it is even compilable for your environment.  The pluggable PL architecture means you can 
write a PL Handler for your favorite language or invent your own language that you can run in the database.   In the end 
the barrier between code,data, and semantic constructs is more of a constraint imposed by compilers.  If you have any doubts about the above statement, you need only look at some javascript injection attacks
to bring the statement home. One of my fantasies is 
developing a language that morphs itself, that utilizes the database as its morphing engine and its OS and that breaks the illusion of data being data, code being code, and lacks rigid semantics.  
Of the languages we have worked with, &lt;a href=&quot;http://en.wikipedia.org/wiki/Smalltalk&quot; target=_blank&gt;SmallTalk&lt;/a&gt; comes closest to a language that satisfies these ideals and Lisp to a much lesser extent.  Lisp lacked the semantic elegance of SmallTalk among other things.
&lt;/P&gt;

&lt;P&gt;Most people are used to having their procedural language push their data around.  PL code living in PostgreSQL allows your data to push your procedural code around in a set-based way.  This is a simple but pretty powerful feature since data is in general more fluid than code. For interpretated/just-in time compiled languages it can live in the database, for compiled it has to call compiled functions. &lt;/P&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/50-Choosing-the-right-Database-Procedural-Language-PL.html#extended&quot;&gt;Continue reading &quot;Choosing the right Database Procedural Language PL&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 10 May 2008 06:58:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/50-guid.html</guid>
    
</item>

</channel>
</rss>