<?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 - plpython</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>Sat, 28 Aug 2010 20:28:01 GMT</pubDate>

    <image>
        <url>http://www.postgresonline.com/journal/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Postgres OnLine Journal - plpython - 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>PLPython Part 5: PLPython meets PostgreSQL Multi-column aggregates and SVG plots</title>
    <link>http://www.postgresonline.com/journal/archives/107-PLPython-Part-5-PLPython-meets-PostgreSQL-Multi-column-aggregates-and-SVG-plots.html</link>
            <category>8.2</category>
            <category>8.3</category>
            <category>8.4</category>
            <category>advanced</category>
            <category>pl programming</category>
            <category>plpython</category>
            <category>postgresql versions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/107-PLPython-Part-5-PLPython-meets-PostgreSQL-Multi-column-aggregates-and-SVG-plots.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=107</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;In our &lt;a href=&quot;http://www.postgresonline.com/journal/archives/102-PLPython-Part-4-PLPython-meets-aggregates.html&quot; target=&quot;_blank&quot;&gt;PLPython Part 4: PLPython meets aggregates&lt;/a&gt; we demonstrated the power of PostgreSQL  in combination
with PLPython to create a sequence of ascii plots by using the power of aggregation.  Our friend &lt;a href=&quot;http://www.spatialdbadvisor.com/&quot; target=&quot;_blank&quot;&gt;Simon Greener over at Spatial Db Advisor&lt;/a&gt; told me the example
was clever but ascii plots was so 70ish and ugly, why didn&#039;t I do SVG plots? He felt people being predominantly visual would be caught up in the ugliness of Ascii plots and miss the point.
At least &lt;a href=&quot;http://www.postgresonline.com/journal/archives/102-PLPython-Part-4-PLPython-meets-aggregates.html#c803&quot; target&quot;_blank&quot;&gt;Bob found them neat and can appreciate the elegance in simplicity, thanks Bob.&lt;/a&gt;.

&lt;p&gt;
To make it up
to Simon, we shall demonstrate 2 features we left out in our prior article.
&lt;/p&gt;
&lt;p&gt;
&lt;OL&gt;&lt;LI&gt;Pretty SVG graphs -- so I don&#039;t have to hear more about SVG from Simon and how I&#039;m caught in the 70s.&lt;/LI&gt;
	&lt;LI&gt;Ability to plot a schedule -- schedule item, start date, end date using a multi-column aggregate function. Here is a good use for multi-column aggregates or at least I think so. (Yeh for Multi-column aggregates)&lt;/LI&gt;
&lt;/OL&gt;
&lt;/p&gt;

&lt;p&gt;If you are into spatial processing in the database or how many ways you can play with XML particularly &lt;a href=&quot;http://www.spatialdbadvisor.com/oracle_spatial_tips_tricks&quot; target=&quot;_blank&quot;&gt;Oracle Locator, Oracle Spatial&lt;/a&gt;, &lt;a href=&quot;http://www.spatialdbadvisor.com/postgis_tips_tricks&quot; target=&quot;_blank&quot;&gt;PostGIS&lt;/a&gt; and &lt;a href=&quot;http://www.spatialdbadvisor.com/sql_server_blog&quot; target=&quot;_blank&quot;&gt;SQL Server 2008&lt;/a&gt;, we highly recommend &lt;a href=&quot;http://www.spatialdbadvisor.com/&quot; target=&quot;_blank&quot;&gt;Simon&#039;s articles&lt;/a&gt;.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/107-PLPython-Part-5-PLPython-meets-PostgreSQL-Multi-column-aggregates-and-SVG-plots.html#extended&quot;&gt;Continue reading &quot;PLPython Part 5: PLPython meets PostgreSQL Multi-column aggregates and SVG plots&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 13 Mar 2009 08:28:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/107-guid.html</guid>
    <category>aggregates</category>
<category>plpython</category>

</item>
<item>
    <title>PL Python Cheatsheet Overview</title>
    <link>http://www.postgresonline.com/journal/archives/106-PL-Python-Cheatsheet-Overview.html</link>
            <category>cheatsheet</category>
            <category>plpython</category>
            <category>special feature</category>
    
    <comments>http://www.postgresonline.com/journal/archives/106-PL-Python-Cheatsheet-Overview.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=106</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;PL/Python is the procedural language for PostgreSQL that allows you to write database stored functions and triggers in Python.  Python has proved to be a charming language and when used for where it excels, enhances the power of PostgreSQL quite nicely.
Unfortunately we can&#039;t quite capture all its charm in a single pager cheat sheet, but hopefully
this will give you a sense of its usefulness.&lt;/P&gt;

&lt;P&gt;Below is a Thumbnail view of the PL\Python cheat sheet.  This is by no means comprehensive, but are the features we thought may be useful to know.
&lt;/P&gt;
&lt;a href=&quot;/special_feature.php?sf_name=postgresql_plpython_cheatsheet&amp;outputformat=pdf&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/images/journal/postgresql_plpython_cheatsheet_small.jpg&quot; border=&quot;1&quot;/&gt;&lt;/a&gt;
&lt;/P&gt;
&lt;P&gt;PDF Portrait version 8.5 x 11&quot; of this cheatsheet is available at &lt;a href=&quot;/special_feature.php?sf_name=postgresql_plpython_cheatsheet&amp;outputformat=pdf&quot; target=&quot;_blank&quot;&gt;PL/Python  Cheatsheet 8.5 x 11&lt;/a&gt; and also available in
&lt;a href=&quot;/special_feature.php?sf_name=postgresql_plpython_cheatsheet&amp;outputformat=a4pdf&quot; target=&quot;_blank&quot;&gt;PDF A4 format&lt;/a&gt; and &lt;a href=&quot;/special_feature.php?sf_name=postgresql_plpython_cheatsheet&amp;outputformat=html&quot; target=_blank&gt;HTML&lt;/a&gt;.
&lt;/P&gt;

&lt;P&gt;Also check out our accompanying tutorials on the topic of PL/Python: &lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/99-Quick-Intro-to-PLPython.html&quot; target=&quot;_blank&quot;&gt;Quick Intro to PLPython&lt;/a&gt;&lt;/LI&gt;
	&lt;LI&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/100-PLPython-Part-2-Control-Flow-and-Returning-Sets.html&quot; target=&quot;_blank&quot;&gt;PLPython Part 2: Control Flow and Returning Sets&lt;/a&gt;&lt;/LI&gt;
	&lt;LI&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/101-PLPython-Part-3-Using-custom-classes,-pulling-data-from-PostgreSQL.html&quot; target=&quot;_blank&quot;&gt;PLPython Part 3: Using custom classes, pulling data from PostgreSQL&lt;/a&gt;&lt;/LI&gt;
	&lt;LI&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/102-PLPython-Part-4-PLPython-meets-aggregates.html&quot; target=&quot;_blank&quot;&gt;PLPython Part 4: PLPython meets aggregates&lt;/a&gt;&lt;/LI&gt;
&lt;/OL&gt; 
    </content:encoded>

    <pubDate>Fri, 06 Mar 2009 20:58:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/106-guid.html</guid>
    
</item>
<item>
    <title>PLPython Part 4: PLPython meets aggregates</title>
    <link>http://www.postgresonline.com/journal/archives/102-PLPython-Part-4-PLPython-meets-aggregates.html</link>
            <category>8.2</category>
            <category>8.3</category>
            <category>8.4</category>
            <category>intermediate</category>
            <category>pl programming</category>
            <category>plpython</category>
    
    <comments>http://www.postgresonline.com/journal/archives/102-PLPython-Part-4-PLPython-meets-aggregates.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=102</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;In our &lt;a href=&quot;/index.php?i_id=7&quot; target=&quot;_blank&quot;&gt;August 2008/ September 2008 issue&lt;/a&gt; we demonstrated the power of PostgreSQL to create median and MS Access-like first and last aggregate functions in
SQL language.  In this article we shall demonstrate how to create aggregates with Python.  We shall
call this function &lt;b&gt;agg_plot&lt;/b&gt;.  What it will do is plot each grouping of data and return a plot for each grouping. The steps
we covered in those articles can be applied here.&lt;/p&gt;

&lt;p&gt;For this part, we shall use the same library we discussed in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/101-PLPython-Part-3-Using-custom-classes,-pulling-data-from-PostgreSQL.html&quot; target=&quot;_blank&quot;&gt;PLPython Part 3: Using custom classes, pulling data from PostgreSQL&lt;/a&gt;.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/102-PLPython-Part-4-PLPython-meets-aggregates.html#extended&quot;&gt;Continue reading &quot;PLPython Part 4: PLPython meets aggregates&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 05 Feb 2009 19:36:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/102-guid.html</guid>
    <category>aggregates</category>
<category>plpython</category>

</item>
<item>
    <title>PLPython Part 3: Using custom classes, pulling data from PostgreSQL</title>
    <link>http://www.postgresonline.com/journal/archives/101-PLPython-Part-3-Using-custom-classes,-pulling-data-from-PostgreSQL.html</link>
            <category>8.3</category>
            <category>8.4</category>
            <category>intermediate</category>
            <category>pl programming</category>
            <category>plpython</category>
    
    <comments>http://www.postgresonline.com/journal/archives/101-PLPython-Part-3-Using-custom-classes,-pulling-data-from-PostgreSQL.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=101</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;One of the great things about Python is the plethora of free libraries around to
do very cool things from Engineering, statistical modeling, to BioInformatics.&lt;/p&gt;

&lt;p&gt;In this Part we shall play around with a simple but pretty neat package called &lt;b&gt;ASCII Plotter&lt;/b&gt; - we found at
&lt;a href=&quot;http://pypi.python.org/pypi?:action=browse&amp;show=all&amp;c=385&quot; target=&quot;_blank&quot;&gt;Python Package Index&lt;/a&gt;
which appears to be kind of a CPAN except for Python instead of Perl.&lt;/p&gt;

&lt;p&gt;For more details on using PL/Python check out PostgreSQL docs &lt;a href=&quot;http://www.postgresql.org/docs/8.3/interactive/plpython.html&quot; target=&quot;_blank&quot;&gt;
PostgreSQL 8.3 PL/Python docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The ASCII Plotter package can also be dowloaded directly from &lt;a href=&quot;http://www.algorithm.co.il/blogs/index.php/ascii-plotter/&quot; target=&quot;_blank&quot;&gt;http://www.algorithm.co.il/blogs/index.php/ascii-plotter/&lt;/a&gt;
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/101-PLPython-Part-3-Using-custom-classes,-pulling-data-from-PostgreSQL.html#extended&quot;&gt;Continue reading &quot;PLPython Part 3: Using custom classes, pulling data from PostgreSQL&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 04 Feb 2009 16:22:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/101-guid.html</guid>
    <category>plpython</category>

</item>
<item>
    <title>PLPython Part 2: Control Flow and Returning Sets</title>
    <link>http://www.postgresonline.com/journal/archives/100-PLPython-Part-2-Control-Flow-and-Returning-Sets.html</link>
            <category>8.4</category>
            <category>intermediate</category>
            <category>pl programming</category>
            <category>plpython</category>
    
    <comments>http://www.postgresonline.com/journal/archives/100-PLPython-Part-2-Control-Flow-and-Returning-Sets.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=100</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;We decided to continue with a Part 2 to this PL/Python series given the surprising popularity
of the first.  In our first article appearing in our January 2009 issue &lt;a href=&quot;http://www.postgresonline.com/journal/archives/99-Quick-Intro-to-PLPython.html&quot; target=&quot;_blank&quot;&gt;Quick Intro to PLPython&lt;/a&gt;
we quickly went over installing PL/Python, doing a function that calls out to the operating system, and doing a quick encoder decoder.
In this article we will provide examples of basic Python controls structures and how to return sets in
PL/Python.  &lt;/p&gt;

&lt;p&gt;Keep in mind that while you may love Python, some things are just better done in SQL language or PL/PGSQL language
so just because you can and you feel more of a comfort level with Python, doesn&#039;t mean you should forget about the other languages.
SQL and PL/PGSQL are still more intimately connected to the PostgreSQL architecture and don&#039;t have an additional environment dependency
to rely on.  That said -- Python has a rich environment and is a much richer language in many respects so is ideal for certain kinds of problems.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/100-PLPython-Part-2-Control-Flow-and-Returning-Sets.html#extended&quot;&gt;Continue reading &quot;PLPython Part 2: Control Flow and Returning Sets&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 30 Jan 2009 14:02:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/100-guid.html</guid>
    <category>plpython</category>

</item>
<item>
    <title>Quick Intro to PLPython</title>
    <link>http://www.postgresonline.com/journal/archives/99-Quick-Intro-to-PLPython.html</link>
            <category>8.3</category>
            <category>8.4</category>
            <category>intermediate</category>
            <category>oracle</category>
            <category>pl programming</category>
            <category>plpython</category>
            <category>sql server</category>
    
    <comments>http://www.postgresonline.com/journal/archives/99-Quick-Intro-to-PLPython.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=99</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;We have mentioned time and time again, one of the great selling points of PostgreSQL is that it has so many languages to choose from
for writing database stored functions and the code you write in those stored functions is almost exactly the same as what you would write when
writing in that language&#039;s environment.  The reason for that is that PostgreSQL applies a thin layer around the environment the language lives in, so your code is really 
running in that environment.  The down-side of this approach is you must have that environment installed on the server.  This is a bit different
from the Microsoft SQL Server model where code you write in VB.NET, C#, IronPython etc. gets translated into Common Runtime Logic (CLR) so your code is not
really running in the environment it would normally breathe in and if you have dependencies you have to enable them in the SQL Server GAC which is different 
from the Server&#039;s .NET GAC.&lt;/p&gt;

&lt;p&gt;In this section we shall introduce PL/Python - which is a PL language handler for Python that allows you to write PostgreSQL stored functions in Python.  First of all I should start off
by saying that we are not proficient Python programmer&#039;s so if anyone sees anything wrong with what we say feel free to embarass us.
&lt;/p&gt;

&lt;p&gt;We are also taking this opportunity to test-drive PostgreSQL 8.4 on both Linux (OpenSUSE) and Windows,
using the &lt;a href=&quot;http://www.enterprisedb.com/products/pgdevdownload.do&quot; target=&quot;_blank&quot;&gt;EnterpriseDB PostgreSQL 8.4 beta&lt;/a&gt;
that Dave Page recently announced on his blog.  This install is great if you are running Windows, MacOSX or Linux Desktop, but 
sadly does not have PostGIS as part of the stack builder option.
&lt;/p&gt;

&lt;p&gt;For pure Linux Server CentOS/Redhat EL/Fedora no desktop installs or if you just feel more comfortable at the command-line, 
&lt;a href=&quot;http://yum.pgsqlrpms.org/news-8.4devel-ready-for-testing.php&quot; target=&quot;_blank&quot;&gt;PostgreSQL Yum repository&lt;/a&gt; generously maintained by Devrim is the one to go for.&lt;/p&gt;
&lt;p&gt;We haven&#039;t tested this one out, but I presume the steps are pretty much what we outlined in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/86-Yum-addendum-for-8.3.5-and-PgAgent.html&quot;&gt;Using PostgreSQL Yum repository&lt;/a&gt;. &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/99-Quick-Intro-to-PLPython.html#extended&quot;&gt;Continue reading &quot;Quick Intro to PLPython&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 22 Jan 2009 17:15:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/99-guid.html</guid>
    <category>plpython</category>

</item>

</channel>
</rss>