<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Digital Divide &#187; postgresql</title>
	<atom:link href="http://www.simonecampora.com/blog/tag/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simonecampora.com/blog</link>
	<description>Simone Campora's Blog: about Databases, GIS, RIA and more...</description>
	<lastBuildDate>Tue, 13 Jul 2010 10:15:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GeoMondrian Example</title>
		<link>http://www.simonecampora.com/blog/2009/11/18/geomondrian-example/</link>
		<comments>http://www.simonecampora.com/blog/2009/11/18/geomondrian-example/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 11:12:45 +0000</pubDate>
		<dc:creator>simonecampora</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[GeoMondrian]]></category>
		<category><![CDATA[GeoMondrian Example]]></category>
		<category><![CDATA[Mondrian OLAP]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[SOLAP]]></category>
		<category><![CDATA[spatial database]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.simonecampora.com/blog/?p=153</guid>
		<description><![CDATA[
As soon as I&#8217;ve started digging into OLAP Architectures I realized how complicated things might become whenever looking for extra features. Most of the commercial OLAP solutions are providing &#8220;classic&#8221; OLAP features for data warehousing. It means that only simple numeric, strings and dates would be supported. Spatial Data Warehouses  architectures instead, are still in [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img src="http://www.spatialytics.org/wp-content/themes/republica/images/logo.png" alt="Spartialitics.org" width="300" height="60" /></p>
<p style="text-align: justify;">As soon as I&#8217;ve started digging into OLAP Architectures I realized how complicated things might become whenever looking for extra features. Most of the commercial OLAP solutions are providing &#8220;classic&#8221; OLAP features for data warehousing. It means that only simple numeric, strings and dates would be supported. Spatial Data Warehouses  architectures instead, are still in their infancy and there exists no commercial product that is actually providing such SOLAP functionalities. There exists several academic proposals instead which can provide a good overview on the features that can be supported by SOLAP Servers.</p>
<p style="text-align: justify;">One of these acedemic prototypes is <a href="http://www.spatialytics.org/projects/geomondrian/">Geo Mondrian</a>.</p>
<p style="text-align: justify;">GeoMondrian is a spatially-enabled version of Pentaho Analysis Services (<a onclick="javascript:pageTracker._trackPageview('/outbound/article/mondrian.pentaho.org');" href="http://mondrian.pentaho.org/">Mondrian</a>). It has been released under the <a onclick="javascript:pageTracker._trackPageview('/outbound/article/www.opensource.org');" href="http://www.opensource.org/licenses/eclipse-1.0.php">EPL</a>. GeoMondrian is the first implementation of a true SOLAP server. It provides a consistent integration of spatial objects into the OLAP data cube structure, instead of fetching them from a separate spatial database, web service or GIS file. To make a simple analogy, GeoMondrian brings to the Mondrian OLAP server what PostGIS brings to the PostgreSQL database management system.</p>
<p style="text-align: justify;">Unfortunately the documentation and getting-started guides are missing right now&#8230; That&#8217;s why I&#8217;ve decided to publish a couple of advices to whom may decide to use GeoMondrian for  developing SOLAP applications. Here attached you can find an archive that contains all that you need to setup a sample SOLAP server with geographic data source. It is designed to be working on PostgreSQL+Postigs since it is the only spatial database to be supported right now.</p>
<p style="text-align: justify;">What you have to do in order to be able to use this unofficial build release of GeoMondrian is to load the .SQL script into your postgresql+postgis database and than run the Test application (be sure that the .XML schema definition is in the same parent directory, to have set up properly your JDBC connection and have included the libraries that are present in the &#8220;lib&#8221; folder).</p>
<p style="text-align: justify;">I hope that it will help!</p>
<p style="text-align: center;"><a href="http://www.simonecampora.com/public/files/geomondrian-example.zip"><img class="aligncenter size-full wp-image-156" title="zip-icon1" src="http://www.simonecampora.com/blog/wp-content/uploads/2009/11/zip-icon1.jpg" alt="zip-icon1" width="73" height="85" /></a></p>
<p><a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="Digg" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/myspace?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="MySpace" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/myspace.png" width="16" height="16" alt="MySpace"/></a> <a href="http://www.addtoany.com/add_to/hotmail?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="Hotmail" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Hotmail"/></a> <a href="http://www.addtoany.com/add_to/msdn?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="MSDN" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/msdn.png" width="16" height="16" alt="MSDN"/></a> <a href="http://www.addtoany.com/add_to/wordpress?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="WordPress" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/wordpress.png" width="16" height="16" alt="WordPress"/></a> <a href="http://www.addtoany.com/add_to/orkut?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="Orkut" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/orkut.png" width="16" height="16" alt="Orkut"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F11%2F18%2Fgeomondrian-example%2F&amp;linkname=GeoMondrian%20Example">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecampora.com/blog/2009/11/18/geomondrian-example/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PostgreSQL Custom Types</title>
		<link>http://www.simonecampora.com/blog/2009/05/16/postgresql-custom-types/</link>
		<comments>http://www.simonecampora.com/blog/2009/05/16/postgresql-custom-types/#comments</comments>
		<pubDate>Sat, 16 May 2009 16:50:26 +0000</pubDate>
		<dc:creator>simonecampora</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database custom types]]></category>
		<category><![CDATA[dbms]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://www.simonecampora.com/blog/?p=54</guid>
		<description><![CDATA[
In the last year I&#8217;ve spent six months digging into a PostgreSQL project. PostgreSQL is one of the most interesting and fast developed database management systems. However it is still a little bit behind the major commercial competitors, it is without any doubt, the most advanced OpenSource and Free DBMS. On the great features of [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.simonecampora.com/blog/wp-content/uploads/2009/05/postgresql.png"><img class="aligncenter size-medium wp-image-56" title="postgresql" src="http://www.simonecampora.com/blog/wp-content/uploads/2009/05/postgresql-290x300.png" alt="postgresql" width="135" height="141" /></a></p>
<p style="text-align: justify;">In the last year I&#8217;ve spent six months digging into a PostgreSQL project. PostgreSQL is one of the most interesting and fast developed database management systems. However it is still a little bit behind the major commercial competitors, it is without any doubt, the most advanced OpenSource and Free DBMS. On the great features of PostgreSQL is the documentation of its architecture, that is maintained updated constantly by its vivid and active community. Although this community provides one of the best (the fastest that I&#8217;ve every experienced as a single user) developer on-line support system, at that time (and still now!) I had serious difficulties to find out information about on of the most used and useful coding extensions: custom types. Some of you may had to work with PostgreSQL extensions like PostGIS (the simplest and most effective spatial extension that integrates spatial information into PostgreSQL) and wanted to extend or to provide similar functionalities so easy to use and comfortable. I was mentioning the user-friendly constructors for spatial objects. Custom Types for defining spatial objects are defined in the SQL language like that</p>
<pre class="brush: sql; collapse: false;">POINT('37','-97');</pre>
<p style="text-align: justify;">(for more information, take a look to <a href="http://www.bostongis.com/postgis_quickguide.bqg">this</a> link)</p>
<p style="text-align: justify;">This type of syntax is only possible (as far as I know) if the type is defined using a C function, and for instance compiled into a .so shared object library provided to PostgreSQL. C PostgreSQL custom types are defined by two functions that translate the low level description of the type into SQL usable constructors. Here it follows the code  to define constructors for a Currency type, and attached into <a href="http://www.simonecampora.com/blog/wp-content/uploads/2009/05/fcur.c">this file</a>, there is the source code for other operations like equals, greater and exchange rate calculation (the source of this piece of code is PostgreSQL C Reference Documentation).</p>
<p style="text-align: justify;">
<pre class="brush: cpp;">/*
**  Name: fcur_in()
**
**        Converts an fcur value from external form
**	  to internal form.
*/

PG_FUNCTION_INFO_V1(fcur_in);

Datum fcur_in(PG_FUNCTION_ARGS)
{
    char  * src     = PG_GETARG_CSTRING(0);
    char  * workStr = (char *)palloc( strlen( src ));
    char  * units   = NULL;
    char  * name    = NULL;
    char  * xrate   = NULL;
    fcur  * result  = NULL;
    char  * endPtr  = NULL;

    strcpy( workStr, src );

    units = strtok( workStr, &quot;(&quot; );
    xrate = strtok( NULL, &quot;/)&quot; );
    name  = strtok( NULL, &quot;)&quot; );

    result = (fcur *)palloc( sizeof( fcur ));

    memset( result, 0x00, sizeof( fcur ));

    result-&amp;gt;fcur_units = strtod( units, &amp;amp;endPtr );

    if( xrate )
    {
	result-&amp;gt;fcur_xrate = strtod( xrate, &amp;amp;endPtr );
    }
    else
    {
	result-&amp;gt;fcur_xrate = 1.0;
    }

    if( name )
    {
	strncpy( result-&amp;gt;fcur_name,
		 name,
		 sizeof( result-&amp;gt;fcur_name ));
    }
    else
    {
	strncpy( result-&amp;gt;fcur_name,
		 unknownCurrencyName,
		 sizeof( result-&amp;gt;fcur_name ));
    }

    PG_RETURN_POINTER( result );
}

/*
**  Name: fcur_out()
**
**        Converts an fcur value from internal form
**	  to external form.
*/

PG_FUNCTION_INFO_V1(fcur_out);

Datum fcur_out(PG_FUNCTION_ARGS)
{
    fcur  * src  = (fcur *)PG_GETARG_POINTER( 0 );
    char  * result;
    char    work[16+1+sizeof(src-&amp;gt;fcur_name)+16];

    sprintf( work, &quot;%g(%g/%s)&quot;,
	     src-&amp;gt;fcur_units,
	     src-&amp;gt;fcur_xrate,
	     src-&amp;gt;fcur_name );

    result = (char *)palloc( strlen( work ) + 1 );

    strcpy( result, work );

    PG_RETURN_CSTRING( result );

}
</pre>
<p><a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="Digg" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/myspace?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="MySpace" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/myspace.png" width="16" height="16" alt="MySpace"/></a> <a href="http://www.addtoany.com/add_to/hotmail?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="Hotmail" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/live.png" width="16" height="16" alt="Hotmail"/></a> <a href="http://www.addtoany.com/add_to/msdn?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="MSDN" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/msdn.png" width="16" height="16" alt="MSDN"/></a> <a href="http://www.addtoany.com/add_to/wordpress?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="WordPress" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/wordpress.png" width="16" height="16" alt="WordPress"/></a> <a href="http://www.addtoany.com/add_to/orkut?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="Orkut" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/orkut.png" width="16" height="16" alt="Orkut"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.simonecampora.com/blog/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.simonecampora.com%2Fblog%2F2009%2F05%2F16%2Fpostgresql-custom-types%2F&amp;linkname=PostgreSQL%20Custom%20Types">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecampora.com/blog/2009/05/16/postgresql-custom-types/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
