<?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 - contrib spotlight</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>Wed, 24 Apr 2013 21:56:48 GMT</pubDate>

    <image>
        <url>http://www.postgresonline.com/journal/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Postgres OnLine Journal - contrib spotlight - 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>Word Play with Spatial SQL</title>
    <link>http://www.postgresonline.com/journal/archives/302-Word-Play-with-Spatial-SQL.html</link>
            <category>contrib spotlight</category>
            <category>postgis</category>
    
    <comments>http://www.postgresonline.com/journal/archives/302-Word-Play-with-Spatial-SQL.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=302</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;In &lt;a href=&quot;http://www.postgresonline.com/journal/archives/293-Saying-Happy-Valentine-in-PostGIS.html&quot; target=&quot;_blank&quot;&gt;Happy Valentine PostGIS&lt;/a&gt; we demonstrated how to use PostGIS raster
to decipher letters from a raster, vectorize them and then reuse this vectorized letters to form new words.  Admittedly the letters were a bit grainy since they were
vectorizations of low res rasters and I didn&#039;t bother smoothing them.  Bruce Rindahl offered a script to SVG to PostGIS geometry and using &lt;a href=&quot;http://xmlgraphics.apache.org/batik/tools/font-converter.html&quot; target=&quot;_blank&quot;&gt;Batik&lt;/a&gt; to convert a font file to SVG format and gave me a hi-res converted kankin fontset. I still haven&#039;t figured out how his script works.&lt;/p&gt;

&lt;p&gt;Bborie Park thought that was all too complicated and thought (as I have always) that we need an &lt;code&gt;ST_GeomFromSVG&lt;/code&gt; function for PostGIS of which he is on a mission to create when he&#039;s less busy.
He also suggested I wrap my letter writer function as an extension.  Taking all these ideas, I formulated an extension you install with&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;CREATE EXTENSION postgis_letters;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;&lt;a href=&quot;http://www.bostongis.com/postgisstuff/postgis_letters_extension.zip&quot; target=&quot;_blank&quot;&gt;postgis_letters&lt;/a&gt;&lt;/b&gt; (http://www.bostongis.com/postgisstuff/postgis_letters_extension.zip) is an sql / data extension containing mostly data, but as the name suggests relying on PostGIS. The data are geometry vectors of the kankin font.  I plan to add in more free fonts later once I figure out how to use Bruce&#039;s script or Bborie comes up with a better way and also more positioning logic and handling of spaces.  So its a little rough at the moment.
The purpose of the extension is so I can write words on my images in reports e.g. state names  or overlay labels on geometry features like roads and land. Using the power of both geometry/raster you can have a fully functioning report image writer that would return a fully formed image for use in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/244-Rendering-PostGIS-Raster-graphics-with-LibreOffice-Base-Reports.html&quot; target=&quot;_blank&quot;&gt;LibreOffice&lt;/a&gt; (or for my ASP.NET web apps Active Reports.NET). This wouldn&#039;t rely on any mapping server to draw images (just pure PostGIS/PostgreSQL). Hopefully with new and improved binary features coming in &lt;a href=&quot;http://people.planetpostgresql.org/andrew/index.php?/archives/283-psql-binary-output.html&quot; target=&quot;_blank&quot;&gt;PSQL for (looks like 9.4)&lt;/a&gt;, outputting these raster images from psql will also be trivial.  While on my mission to do something useful, I got distracted by something more entertaining: describing spatial processes with words. Here it goes.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/302-Word-Play-with-Spatial-SQL.html#extended&quot;&gt;Continue reading &quot;Word Play with Spatial SQL&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 21 Apr 2013 20:44:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/302-guid.html</guid>
    <category>extensions</category>
<category>postgis</category>

</item>
<item>
    <title>pgRouting windows binaries for PostgreSQL 9.2 32-bit and 64-bit</title>
    <link>http://www.postgresonline.com/journal/archives/300-pgRouting-windows-binaries-for-PostgreSQL-9.2-32-bit-and-64-bit.html</link>
            <category>9.2</category>
            <category>9.3</category>
            <category>contrib spotlight</category>
            <category>pgRouting</category>
            <category>postgis</category>
            <category>postgresql versions</category>
            <category>winextensions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/300-pgRouting-windows-binaries-for-PostgreSQL-9.2-32-bit-and-64-bit.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=300</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;We&#039;ve got experimental &lt;a href=&quot;http://pgrouting.org&quot; target=&quot;_blank&quot;&gt;pgRouting&lt;/a&gt; windows binaries available for windows PostgreSQL 9.2 32-bit and 64-bit for pgRouting 1.0.7 development branch.  More details on our &lt;a href=&quot;http://www.bostongis.com/blog/index.php?/archives/215-pgRouting-1.07dev-windows-binaries-available-for-PostgreSQL-9.2-32-bit-and-64-bit.html&quot; target=&quot;_blank&quot;&gt;Boston GIS blog page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The final versions we plan to release with upcoming PostGIS 2.1 PostgreSQL 9.2 on stackbuilder as part of the PostGIS install. Barring no difficulties we&#039;ll also have experimental binaries for PostgreSQL 9.3 releases once 9.3 reaches beta.&lt;/p&gt;

&lt;p&gt;This version and upcoming pgRouting versions support the PostgreSQL extension model, so if you have postgis already installed, its just an additonal simple step:&lt;/p&gt;
&lt;br /&gt;&lt;code&gt;CREATE EXTENSION pgrouting;&lt;/code&gt; 
    </content:encoded>

    <pubDate>Tue, 09 Apr 2013 00:26:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/300-guid.html</guid>
    <category>pgrouting</category>
<category>postgis</category>
<category>windows</category>

</item>
<item>
    <title>PostgreSQL 9.3 postgres_fdw: a Test Drive</title>
    <link>http://www.postgresonline.com/journal/archives/294-PostgreSQL-9.3-postgres_fdw-a-Test-Drive.html</link>
            <category>9.3</category>
            <category>fdws</category>
            <category>new in postgresql</category>
            <category>postgis</category>
            <category>postgresql versions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/294-PostgreSQL-9.3-postgres_fdw-a-Test-Drive.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=294</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;Just recently saw Michael Paguier&#039;s article on the &lt;a href=&quot;http://michael.otacoo.com/postgresql-2/postgres-9-3-feature-highlight-postgres_fdw/&quot; target=&quot;_blank&quot;&gt;recent commit of postgres_fdw&lt;/a&gt; so I was excited to try this out for myself.  Questions we wanted to answer/experience were:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;Can I connect against different versions of PostgreSQL?&lt;/i&gt; Yes to test I tried connecting from my PostgreSQL 9.3 dev instance to my 9.2 instance on another box.&lt;/li&gt;
	&lt;li&gt;&lt;i&gt;Can I use a foreign type like -- you guessed it &lt;b&gt;PostGIS&lt;/b&gt; if we have same version of PostGIS installed on both databases?&lt;/i&gt; Yes. I didn&#039;t try with different versions so not sure if that would work especially since the structure changed a bit between 1.5 and 2.0.  I suspect 2.0 and 2.1 would work fine and might be a good way to cheat run 2.1 on 9.3 but creating derivatives of my 2.0 data with functions only available in 2.1.&lt;/li&gt;
	&lt;li&gt;&lt;i&gt;Will it use my spatial index?&lt;/i&gt; No or at least we couldn&#039;t figure out how and I don&#039;t see how it is possible, but would be nice if it could be&lt;/li&gt;
	&lt;li&gt;&lt;i&gt;Can I have a table defined with dynamic SQL?&lt;/i&gt; Nope or at least the docs don&#039;t mention it.  This is a feature I really liked about the ODBC_FDW
		because often times I want the table to be filtered especially if I need my filter to use an expensive index like a spatial one or utilize functions only available on the foreign server.  If that were part of the definition of the foreign table, then it could in theory process that part on the foreign server. So this makes postgres_fdw not a good replacement for dblink in many cases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So here are the tests we did to experiment with:&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/294-PostgreSQL-9.3-postgres_fdw-a-Test-Drive.html#extended&quot;&gt;Continue reading &quot;PostgreSQL 9.3 postgres_fdw: a Test Drive&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 22 Feb 2013 23:12:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/294-guid.html</guid>
    <category>fdw</category>
<category>foreign data wrapper</category>
<category>postgres_fdw</category>

</item>
<item>
    <title>PostgreSQL 9.2 windows binaries for file_textarray_fdw</title>
    <link>http://www.postgresonline.com/journal/archives/286-PostgreSQL-9.2-windows-binaries-for-file_textarray_fdw.html</link>
            <category>9.2</category>
            <category>contrib spotlight</category>
            <category>fdws</category>
            <category>postgresql versions</category>
            <category>winextensions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/286-PostgreSQL-9.2-windows-binaries-for-file_textarray_fdw.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=286</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;We discussed a while back the &lt;a href=&quot;http://www.postgresonline.com/journal/archives/251-File-FDW-Family-Part-2-file_textarray_fdw-Foreign-Data-Wrapper.html&quot; target=&quot;_blank&quot;&gt;Text array foreign data wrapper&lt;/a&gt; that allows you to register and query a delimited file as if it were a regular table with one array column.
It&#039;s probably the FDW we use most often and reminded of that recently when I had to query a 500,000 record resident list tab delimited file to prep for geocoding.&lt;/p&gt;

&lt;p&gt;When we upgraded to 9.2 and we could no longer compile, I wrote to Andrew Dunstan about this and &lt;a href=&quot;http://people.planetpostgresql.org/andrew/index.php?/archives/291-File-Text-Array-FDW-changes.html&quot; target=&quot;_blank&quot;&gt;he kindly created a 9.2 version&lt;/a&gt;.
Unfortunately there are still quite a few FDWs broken as a result of the 9.2 changes and I was hoping to try to apply similar patches to them that I saw Andrew do, but
haven&#039;t had the patience or time yet. Anyway we&#039;ve compiled these for 9.2 under our mingw64-w64 and mingw64-w32 chains using Andrew&#039;s 9.2 GitHub stable branch. 
&lt;a href=&quot;https://github.com/adunstan/file_text_array_fdw/tree/REL9_2_STABLE&quot;&gt;https://github.com/adunstan/file_text_array_fdw/tree/REL9_2_STABLE&lt;/a&gt;
and we&#039;ve tested them using the PostgreSQL EDB windows VC++ compiled versions. We hope you find them as useful as we have.
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;/downloads/fdw_win32_92_bin.zip&quot;&gt;PostgreSQL 9.2 w32 FDWs&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/downloads/fdw_win64_92_bin.zip&quot;&gt;PostgreSQL 9.2 w64 FDWs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&#039;m hoping to add more FDWs to these 9.2 bags once
we have those working again. If you want to compile yourself or compile others, we have instructions in the packaged README.txt.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sat, 19 Jan 2013 14:06:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/286-guid.html</guid>
    <category>fdw</category>
<category>file_textarray_fdw</category>
<category>foreign data wrapper</category>
<category>postgresql 9.2</category>
<category>windows</category>

</item>
<item>
    <title>PostgreSQL 9.3 Lateral Part 1: Use with HStore</title>
    <link>http://www.postgresonline.com/journal/archives/284-PostgreSQL-9.3-Lateral-Part-1-Use-with-HStore.html</link>
            <category>9.3</category>
            <category>contrib spotlight</category>
            <category>hstore</category>
            <category>postgis</category>
            <category>postgresql versions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/284-PostgreSQL-9.3-Lateral-Part-1-Use-with-HStore.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=284</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;One of the improvements coming in PostgreSQL 9.3 is the new &lt;code&gt;LATERAL&lt;/code&gt; SQL clause.  LATERAL allows you to write more
succinct code than you would be able to otherwise and will be a welcome companion to extensions like hstore and PostGIS which both
have a plethora of set returning functions.  In this article, I&#039;ll just demonstrate it&#039;s use with hstore and subsequent I&#039;ll talk
about it&#039;s potential use in PostGIS raster,geometry, and topology for exploding subelements.&lt;/p&gt;

&lt;p&gt;One thing I was very interested in aside from the succinctness is whether it will be more performant than the older approach.
A perfect test case for hstore would be the example we just demonstrated in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/283-Unpivoting-data-in-PostgreSQL.html&quot; target=&quot;_blank&quot;&gt;Unpivoting data in PostgreSQL&lt;/a&gt;.  For this example, we&#039;ll rewrite the hstore view using LATERAL instead of employing a subselect.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/284-PostgreSQL-9.3-Lateral-Part-1-Use-with-HStore.html#extended&quot;&gt;Continue reading &quot;PostgreSQL 9.3 Lateral Part 1: Use with HStore&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 06 Jan 2013 07:00:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/284-guid.html</guid>
    <category>lateral</category>
<category>postgresql 9.3</category>

</item>
<item>
    <title>Unpivoting data in PostgreSQL</title>
    <link>http://www.postgresonline.com/journal/archives/283-Unpivoting-data-in-PostgreSQL.html</link>
            <category>9.2</category>
            <category>contrib spotlight</category>
            <category>hstore</category>
            <category>postgresql versions</category>
            <category>sql server</category>
            <category>tablefunc</category>
    
    <comments>http://www.postgresonline.com/journal/archives/283-Unpivoting-data-in-PostgreSQL.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=283</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;A while ago we demonstrated how to &lt;a href=&quot;http://www.postgresonline.com/journal/archives/14-CrossTab-Queries-in-PostgreSQL-using-tablefunc-contrib.html&quot; target=&quot;_blank&quot;&gt;create cross tabulation tables&lt;/a&gt; using &lt;em&gt;&lt;a href=&quot;http://www.postgresql.org/docs/current/interactive/tablefunc.html&quot; target=&quot;_blank&quot;&gt;tablefunc&lt;/a&gt;&lt;/em&gt; extension aka (Pivot Tables) (basically collapsing
rows into columns).
Recently someone asked me how to do the reverse (convert columns to rows).  He found a solution to the problem here: &lt;a href=&quot;http://stackoverflow.com/questions/1128737/unpivot-and-postgresql&quot;&gt;http://stackoverflow.com/questions/1128737/unpivot-and-postgresql&lt;/a&gt;
using a combination of &lt;b&gt;&lt;a href=&quot;http://www.postgresql.org/docs/current/interactive/functions-array.html&quot; target=&quot;_blank&quot;&gt;array&lt;/a&gt;&lt;/b&gt; and &lt;b&gt;unnest&lt;/b&gt;.  That approach is very similar to &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms177410%28v=sql.105%29.aspx&quot; target=&quot;_blank&quot;&gt;SQL Server&#039;s built-in Pivot SQL predicate&lt;/a&gt;. 
The solution seemed
nice enough except similar to the SQL Server Unpivot, it required knowing the column names  beforehand so very hard to genericize. 
So would it be possible to accomplish this feat without knowing the columns names (except for the key) and be able to do it with one SQL statement.  I realized that the 
PostgreSQL &lt;em&gt;&lt;a href=&quot;http://www.postgresql.org/docs/current/interactive/hstore.html&quot; target=&quot;_blank&quot;&gt;hstore&lt;/a&gt;&lt;/em&gt; extension fit the bill nicely. In this article I&#039;ll demonstrate both approaches by creating a view 
using both.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/283-Unpivoting-data-in-PostgreSQL.html#extended&quot;&gt;Continue reading &quot;Unpivoting data in PostgreSQL&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 04 Jan 2013 15:03:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/283-guid.html</guid>
    <category>cross tabulation</category>
<category>hstore</category>
<category>pivot</category>
<category>tablefunc</category>
<category>unpivot</category>

</item>
<item>
    <title>Creating GeoJSON Feature Collections with JSON and PostGIS functions</title>
    <link>http://www.postgresonline.com/journal/archives/267-Creating-GeoJSON-Feature-Collections-with-JSON-and-PostGIS-functions.html</link>
            <category>9.2</category>
            <category>application development</category>
            <category>json</category>
            <category>postgis</category>
            <category>postgresql versions</category>
            <category>webservices</category>
    
    <comments>http://www.postgresonline.com/journal/archives/267-Creating-GeoJSON-Feature-Collections-with-JSON-and-PostGIS-functions.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=267</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;If you do a lot of web-based GIS applications, a common desire is to allow a user to 
draw out an area on the map and then do searches against that area and return back a FeatureCollection
where each feature is composed of a geometry and attributes about that feature. In the past the format
was GML or KML, but the world seems to be moving to prefer JSON/GeoJSON.  Normally you&#039;d throw
a mapping server that talks Web Feature Service 
, do more or less with a webscripting glue, or use a Webservice
such as &lt;a href=&quot;http://cartodb.com/maps&quot; target=&quot;_blank&quot;&gt;CartoDb&lt;/a&gt; that lets you pass along raw SQL.&lt;/p&gt;
&lt;p&gt;In this article we&#039;ll demonstrate how to build GeoJSON feature collections that can be consumed by web mapping apps.
 using
the built in JSON functions in PostgreSQL 9.2 and some PostGIS hugging.  
Even if you
don&#039;t use PostGIS, we hope you&#039;ll come away with some techniques for working with 
PostgreSQL extended types and also how to morph relational data into JSON buckets.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/267-Creating-GeoJSON-Feature-Collections-with-JSON-and-PostGIS-functions.html#extended&quot;&gt;Continue reading &quot;Creating GeoJSON Feature Collections with JSON and PostGIS functions&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 24 Aug 2012 02:55:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/267-guid.html</guid>
    <category>geojson</category>
<category>json</category>
<category>plv8</category>
<category>postgis</category>
<category>postgresql 9.2</category>

</item>
<item>
    <title>Schemas vs. Schemaless structures and The PostgreSQL Type Farm</title>
    <link>http://www.postgresonline.com/journal/archives/265-Schemas-vs.-Schemaless-structures-and-The-PostgreSQL-Type-Farm.html</link>
            <category>9.2</category>
            <category>editor note</category>
            <category>hstore</category>
            <category>ltree</category>
            <category>postgis</category>
    
    <comments>http://www.postgresonline.com/journal/archives/265-Schemas-vs.-Schemaless-structures-and-The-PostgreSQL-Type-Farm.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=265</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;There has been a lot of talk lately about &lt;a href=&quot;http://dbdebunk.blogspot.it/2012/08/schema-nosql-and-relational-model-part-1.html&quot; target=&quot;_blank&quot;&gt;schemaless models touted by NoSQL groups&lt;/a&gt; and &lt;A href=&quot;http://archives.postgresql.org/pgsql-advocacy/2012-08/msg00052.php&quot; target=&quot;_blank&quot;&gt;how PostgreSQL fits into this New world order&lt;/a&gt;. 
Is PostgreSQL Object-Relational? Is it &lt;a href=&quot;http://database-explorer.blogspot.com/2012/08/postgresql-multi-model-database-server.html&quot; target=&quot;_blank&quot;&gt;Multi-Model&lt;/a&gt;. We tend to think of PostgreSQL as type liberal and it&#039;s liberalness gets more liberal with each new release. PostgreSQL is fundamentally relational, but has little bias about what data types define each column of related tables. One of PostgreSQL great strengths is the ease with which different types can coexist in the same table and the &lt;a href=&quot;http://www.postgresql.org/docs/9.2/interactive/indexam.html&quot; target=&quot;_blank&quot;&gt;flexible index plumbing&lt;/a&gt; and plan optimizer it provides that allows each type, regardless of how wild, to take full advantage of various index strategies and custom index bindings.  Our 3 favorite custom non-built-in types we use in our workflow are
&lt;a href=&quot;http://www.postgis.org&quot; target=&quot;_blank&quot;&gt;PostGIS (of course)&lt;/a&gt;, &lt;a href=&quot;http://www.postgresql.org/docs/current/static/ltree.html&quot;&gt;LTree (Hierarchical Type)&lt;/a&gt;, and &lt;a href=&quot;http://www.postgresql.org/docs/current/interactive/hstore.html&quot; target=&quot;_blank&quot;&gt;HStore (Key-Value type)&lt;/a&gt;. In some cases, we may use all 3 in the same database and sometimes the same table - where we use PostGIS for spatial location, LTree for logical location, and Hstore just to keep track of random facts about an object that are easier to access than having a separate related table and are too random to warrant devoting a separate column for each. Sometimes we are guilty of using xml as well when we haven&#039;t figured out what schema model best fits a piece of data and hstore is too flat of a type to work. The advent of JSON in PostgreSQL 9.2 does provide for a nested schema-less model similar to what the XML type offers, but more JavaScript friendly.  I personally see JSON as more of a useful transport type than one I&#039;d build my business around or a type you&#039;d use when you haven&#039;t figured out what if any structure is most suitable for your data. When you have no clue what structure a piece of data should be stored, you should let the data tell you what structure it wants to be stored in and only then will you discover by storing it in a somewhat liberal fashion how best to retrofit in a more structural self-descriptive manner. Schemas are great because they are self-describing, but they are not great when your data does not want to sit in a self-described bucket. You may find in the end that some data is just wild and refuses to stay between the lines and then by all means stuff it in xml or json or create a whole new type suit it feels comfortable in.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 12 Aug 2012 05:18:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/265-guid.html</guid>
    <category>postgis</category>
<category>postgresql 9.2</category>

</item>
<item>
    <title>Building on MingW and deploying on VC compiled PostgreSQL Why and Why not</title>
    <link>http://www.postgresonline.com/journal/archives/260-Building-on-MingW-and-deploying-on-VC-compiled-PostgreSQL-Why-and-Why-not.html</link>
            <category>contrib spotlight</category>
            <category>PLR</category>
            <category>postgis</category>
    
    <comments>http://www.postgresonline.com/journal/archives/260-Building-on-MingW-and-deploying-on-VC-compiled-PostgreSQL-Why-and-Why-not.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=260</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;We are the windows package maintainers of PostGIS.  We build these packages using MingW chain of tools. For other packages we fancy that do not come packaged with the windows VC++ builds, we also build these under mingw.   We&#039;ve described some of these already in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/250-File-FDW-Family-Part-1-file_fdw.html&quot; target=&quot;_blank&quot;&gt;File FDW family&lt;/a&gt;.  For windows 32 builds we build
with the commonly known &lt;a href=&quot;http://www.mingw.org/wiki/msys/&quot;&gt;MSys/Mingw32&lt;/a&gt; chain (but an older version 1.0.11) 
because of issues we have building with the newer msys/mingw 32.  
For windows 64-bit installs, we build with the &lt;a href=&quot;http://mingw-w64.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;mingw-w64&lt;/a&gt; chain and in fact 
we like the ming-w64 chain so much that we plan to migrate our Mingw32 to mingw64.  We have PostgreSQL 9.2 and PostgreSQL 9.3 successfully installing under the mingw-w64 for windows 32 just fine (older PostgreSQL we experience a winsock.h something or other error which we are working on troubleshooting.  For 64-bit we use ming-w64 for building extensions for PostgreSQL 9.0-9.2 and soon 9.3 with some minor issues. Some people have asked us, why put yourself thru this torture? Why not just build on MS VC++ for everything?  Originally we had started on mingw because PostGIS needed a Unix like environment to compile and run thru the battery of tests.  This is still the case, though PostGIS is planning a CMake move with help from &lt;a href=&quot;http://mateusz.loskot.net/&quot; target=&quot;_blank&quot;&gt;Mateusz Lostkot&lt;/a&gt; which hopefuly will provide a better cross-platform experience and allows us to integrate pgRouting (which already is on CMake). &lt;a href=&quot;http://blog.cleverelephant.ca&quot; target=&quot;_blank&quot;&gt;Paul Ramsey&lt;/a&gt; rewrote many of the regression test scripts to be completely Perl based and not require sh.  The other reality is we just prefer mingw and can&#039;t really stomach having to work with VC++. I&#039;ll describe why and why not build with mingw and deploy on VC++ compiled PostgreSQL.&lt;/p&gt;  &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/260-Building-on-MingW-and-deploying-on-VC-compiled-PostgreSQL-Why-and-Why-not.html#extended&quot;&gt;Continue reading &quot;Building on MingW and deploying on VC compiled PostgreSQL Why and Why not&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 15 Jul 2012 23:59:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/260-guid.html</guid>
    
</item>
<item>
    <title>Foreign Data Wrap (FDW) Text Array, hstore, and Jagged Arrays</title>
    <link>http://www.postgresonline.com/journal/archives/259-Foreign-Data-Wrap-FDW-Text-Array,-hstore,-and-Jagged-Arrays.html</link>
            <category>9.1</category>
            <category>9.2</category>
            <category>contrib spotlight</category>
            <category>cte</category>
            <category>fdws</category>
            <category>hstore</category>
            <category>postgresql versions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/259-Foreign-Data-Wrap-FDW-Text-Array,-hstore,-and-Jagged-Arrays.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=259</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;As we discussed in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/251-File-FDW-Family-Part-2-file_textarray_fdw-Foreign-Data-Wrapper.html&quot; target=&quot;_blank&quot;&gt;file_textarray_fdw Foreign Data Wrapper&lt;/a&gt;, &lt;a href=&quot;http://people.planetpostgresql.org/andrew/index.php?/archives/271-Deploying-file_text_array-Foreign-Data-wrapper.html&quot; target=&quot;_blank&quot;&gt;Andrew Dunstan&#039;s text array foreign data wrapper&lt;/a&gt; works great for bringing in a delimited file and not having to worry about the column names until they are in.
We had demonstrated one way to tag the field names to avoid having to keep track of index locations, by using hstore and the header column in conjunction.  
The problem with that is it doesn&#039;t work for jagged arrays.  Jagged arrays are when not all rows have the same number of columns. I&#039;ve jury rigged a small example
to demonstrate the issue.  Luckily with the power of PostgreSQL arrays you can usually get around this issue and still have nice names for your columns.  We&#039;ll demonstrate that too.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/259-Foreign-Data-Wrap-FDW-Text-Array,-hstore,-and-Jagged-Arrays.html#extended&quot;&gt;Continue reading &quot;Foreign Data Wrap (FDW) Text Array, hstore, and Jagged Arrays&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 15 Jul 2012 02:35:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/259-guid.html</guid>
    <category>array</category>
<category>common table expressions</category>
<category>cte</category>
<category>file_textarray_fdw</category>
<category>foreign data wrapper</category>
<category>postgresql 9.1</category>

</item>
<item>
    <title>PostgreSQL 9.2: Preserving column names of subqueries</title>
    <link>http://www.postgresonline.com/journal/archives/254-PostgreSQL-9.2-Preserving-column-names-of-subqueries.html</link>
            <category>9.2</category>
            <category>hstore</category>
            <category>new in postgresql</category>
            <category>postgresql versions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/254-PostgreSQL-9.2-Preserving-column-names-of-subqueries.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=254</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;There is another new feature in 9.2 that doesn&#039;t get much press, and probably because it&#039;s hard to explain.  It is a pretty useful feature if you are working with the new json type or the existing hstore type.  In prior versions if you used a subquery and converted the rows to hstore or json  the column names were not preserved.  Andrew mentioned a back-port path for this issue in &lt;a href=&quot;http://people.planetpostgresql.org/andrew/index.php?/archives/272-Upgradable-JSON.html&quot; target=&quot;_blank&quot;&gt;Upgradeable JSON&lt;/a&gt;. We described a workaround for this issue in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/238-Mail-Merging-using-Hstore.html&quot;&gt;Mail merging using hstore&lt;/a&gt;.  The workaround for including PostGIS geometry in json record output as described in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/253-PostgreSQL-9.2-native-json-type-support.html&quot; target=&quot;_blank&quot;&gt;Native JSON type support&lt;/a&gt; wouldn&#039;t work as nicely without this enhancement. Here is an example to demonstrate.&lt;/p&gt;

 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/254-PostgreSQL-9.2-Preserving-column-names-of-subqueries.html#extended&quot;&gt;Continue reading &quot;PostgreSQL 9.2: Preserving column names of subqueries&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 07 Jun 2012 01:17:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/254-guid.html</guid>
    <category>hstore</category>
<category>json</category>
<category>postgresql 9.2</category>

</item>
<item>
    <title>File FDW Family: Part 2 file_textarray_fdw Foreign Data Wrapper</title>
    <link>http://www.postgresonline.com/journal/archives/251-File-FDW-Family-Part-2-file_textarray_fdw-Foreign-Data-Wrapper.html</link>
            <category>9.1</category>
            <category>contrib spotlight</category>
            <category>fdws</category>
            <category>postgresql versions</category>
            <category>winextensions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/251-File-FDW-Family-Part-2-file_textarray_fdw-Foreign-Data-Wrapper.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=251</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;Last time we demonstrated &lt;a href=&quot;http://www.postgresonline.com/journal/archives/250-File-FDW-Family-Part-1-file_fdw.html&quot; target=&quot;_blank&quot;&gt;how to query delimited text files&lt;/a&gt; using the &lt;a href=&quot;http://www.postgresql.org/docs/current/interactive/file-fdw.html&quot;&gt;&lt;em&gt;fdw_file&lt;/em&gt;&lt;/a&gt; that comes packaged with PostgreSQL 9.1+, this time we&#039;ll continue our journey into Flat file querying Foreign Data Wrapper using an experimental foreign data wrapper designed for also querying delimited data, but outputting it as a single column text array table. 
This one is called &lt;em&gt;file_textarray_fdw&lt;/em&gt; and developed by Andrew Dunstan.  It&#039;s useful if you are dealing with for example jagged files, where not all columns are not properly filled in for each record or there are just a ton of columns you don&#039;t want to bother itemizing before you bring in. The benefit is you can still query and decide how you want to break it apart. You can grab the source code from &lt;a href=&quot;https://github.com/adunstan/file_text_array_fdw&quot; target=&quot;_blank&quot;&gt;file_text_array_fdw source code&lt;/a&gt;.  If you are on windows, we have compiled binaries in our Bag o&#039; FDWs for both &lt;a href=&quot;/downloads/fdw_win32_91_bin.zip&quot;&gt;PostgreSQL 9.1 32-bit FDW  for Windows bag&lt;/a&gt; and &lt;a href=&quot;/downloads/fdw_win64_91_bin.zip&quot;&gt;PostgreSQL 9.1 64-bit FDW for Windows bag&lt;/a&gt; that should work fine with the EDB installed windows binaries. 
For other systems, the compile is fairly easy if you have the postgresql development libraries installed.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/251-File-FDW-Family-Part-2-file_textarray_fdw-Foreign-Data-Wrapper.html#extended&quot;&gt;Continue reading &quot;File FDW Family: Part 2 file_textarray_fdw Foreign Data Wrapper&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 09 May 2012 23:46:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/251-guid.html</guid>
    <category>fdw</category>
<category>file_textarray_fdw</category>
<category>foreign data wrapper</category>
<category>hstore</category>
<category>postgresql 9.1</category>

</item>
<item>
    <title>File FDW Family: Part 1 file_fdw</title>
    <link>http://www.postgresonline.com/journal/archives/250-File-FDW-Family-Part-1-file_fdw.html</link>
            <category>9.1</category>
            <category>contrib spotlight</category>
            <category>fdws</category>
            <category>postgresql versions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/250-File-FDW-Family-Part-1-file_fdw.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=250</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;Last time we demonstrated how to use the &lt;a href=&quot;http://www.postgresonline.com/journal/archives/246-ODBC-Foreign-Data-wrapper---odbc_fdw-on-windows.html&quot; target=&quot;_blank&quot;&gt;ODBC Foreign Data wrapper&lt;/a&gt;, this time we&#039;ll continue our journey into Foreign Data Wrapper land by demonstrating what I&#039;ll call the &lt;em&gt;File FDW family of Foreign Data Wrappers&lt;/em&gt;.  There is one that usually comes packaged with PostgreSQL 9.1 which is called &lt;a href=&quot;http://www.postgresql.org/docs/9.1/interactive/file-fdw.html&quot;&gt;&lt;em&gt;fdw_file&lt;/em&gt;&lt;/a&gt; but there are two other experimental ones I find very useful which are 
developed by Andrew Dunstan both of which Andrew demoed in &lt;a href=&quot;http://people.planetpostgresql.org/andrew/uploads/fdw2.pdf&quot;&gt;PostgreSQL Foreign Data Wrappers&lt;/a&gt; and talked
about a little bit &lt;a href=&quot;http://people.planetpostgresql.org/andrew/index.php?/archives/260-Text-files-from-a-remote-source.html&quot; target=&quot;_blank&quot;&gt;Text files from a remote source&lt;/a&gt;.  As people who have to deal with text data files day in and out, especially ones from mainframes, these satisfy a certain itch.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;file_fdw - for querying delimited text files.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/adunstan/file_fixed_length_record_fdw&quot; target=&quot;_blank&quot;&gt;file_fixed_length_fdw&lt;/a&gt; - this one deals with fixed length data. We discussed methods of importing fixed length data in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/157-Import-fixed-width-data-into-PostgreSQL-with-just-PSQL.html&quot;&gt;Import Fixed width data&lt;/a&gt;.  This is yet another approach but has the benefit that you can also use it to import just a subset of a file. &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/adunstan/file_text_array_fdw&quot; target=&quot;_blank&quot;&gt;file_text_array_fdw&lt;/a&gt; - this one queries a delimited file as if each delimiete row was a text array.  It is ideal for those less than perfect moments when someone gives you a file with a 1000 columns and you don&#039;t have patience to look at what the hell those columns mean just yet.&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;In this article, we&#039;ll just cover the &lt;code&gt;file_fdw&lt;/code&gt; one, but will follow up in subsequent articles, demonstrating the array and fixed length record ones.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/250-File-FDW-Family-Part-1-file_fdw.html#extended&quot;&gt;Continue reading &quot;File FDW Family: Part 1 file_fdw&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 03 May 2012 15:43:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/250-guid.html</guid>
    <category>fdw</category>
<category>foreign data wrapper</category>
<category>postgresql 9.1</category>

</item>
<item>
    <title>ODBC Foreign Data wrapper to query SQL Server on Window - Part 2</title>
    <link>http://www.postgresonline.com/journal/archives/249-ODBC-Foreign-Data-wrapper-to-query-SQL-Server-on-Window-Part-2.html</link>
            <category>9.1</category>
            <category>contrib spotlight</category>
            <category>fdws</category>
            <category>sql server</category>
    
    <comments>http://www.postgresonline.com/journal/archives/249-ODBC-Foreign-Data-wrapper-to-query-SQL-Server-on-Window-Part-2.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=249</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;As promised in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/246-ODBC-Foreign-Data-wrapper---odbc_fdw-on-windows.html&quot; target=&quot;_blank&quot;&gt;our prior article: ODBC Foreign Data wrapper on windows&lt;/a&gt;, we&#039;ll demonstrate how to query SQL Server using the Foreign Data Wrapper.  This we are testing on windows.
As far as querying SQL Server / PostgreSQL goes, the Foreign Data Wrapper still lacks many features that the &lt;a href=&quot;http://www.postgresonline.com/journal/archives/103-Using-Microsoft-SQL-Server-to-Update-PostgreSQL-Data.html&quot; target=&quot;_blank&quot;&gt;SQL Server Linked Server&lt;/a&gt; approach provides.
The key ones we find currently lacking: ability to do updates and reference a table directly from server without knowing underlying structure. That said
the Foreign data Wrapper approach has possiblity to support a lot more data sources with ease.  We&#039;ll demonstrate in subsequent articles using the &lt;b&gt;www_fdw&lt;/b&gt; to query 
web services which we&#039;ve been playing a lot with and the often packaged in &lt;b&gt;file_fdw&lt;/b&gt;. Enough of that let&#039;s start with a concrete example.&lt;/p&gt;

&lt;p&gt;Warning, this is not production ready, but seems like a very promising start and with more testing can become very robust. Although we are demonstrating odbc_fdw on windows,
it is supported on Unix via the UnixODBC, but the data sources you can query will probably be different.
I&#039;m really looking forward to how the FDW technology in PostgreSQL will push the envelop.  I&#039;ve been playing around with the &lt;b&gt;www_fdw&lt;/b&gt; as well and been impressed how easily it is to 
query webservices with SQL. A very ah-hah moment.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/249-ODBC-Foreign-Data-wrapper-to-query-SQL-Server-on-Window-Part-2.html#extended&quot;&gt;Continue reading &quot;ODBC Foreign Data wrapper to query SQL Server on Window - Part 2&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 15 Apr 2012 20:09:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/249-guid.html</guid>
    <category>fdw</category>
<category>foreign data wrapper</category>
<category>postgresql 9.1</category>
<category>sql server</category>

</item>
<item>
    <title>ODBC Foreign Data wrapper - odbc_fdw on windows</title>
    <link>http://www.postgresonline.com/journal/archives/246-ODBC-Foreign-Data-wrapper-odbc_fdw-on-windows.html</link>
            <category>9.1</category>
            <category>fdws</category>
            <category>new in postgresql</category>
            <category>winextensions</category>
    
    <comments>http://www.postgresonline.com/journal/archives/246-ODBC-Foreign-Data-wrapper-odbc_fdw-on-windows.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=246</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;One of the new features in PostgreSQL 9.1 that we&#039;ve been meaning to try is the new foreign data wrapper support.
Now that we are in compile mode gearing up for releasing PostGIS 2.0.0 for windows (both 32 and 64-bit), we thought we&#039;d give the &lt;a href=&quot;http://pgxn.org/dist/odbc_fdw/&quot; target=&quot;_blank&quot;&gt;odbc_fdw&lt;/a&gt; a try trying to compile on windows.  Last we tried we weren&#039;t successful because
we couldn&#039;t get past the -lodbc required step.&lt;/p&gt;

&lt;p&gt;It turns out there is an easy fix to the ODBC dependency issue and I&#039;m not sure I changed the line right.  In the makefile we changed &lt;b&gt;-lodbc&lt;/b&gt; to &lt;b&gt;-lodbc32&lt;/b&gt;.  This was needed for both compiling 32-bit as well as the 64-bit. We compiled the 64-bit version under our Mingw-64 chain
and 32-bit under our old Mingw gcc 3.4.5.  Sadly we still don&#039;t have our mingw64 (compile for windows 32-bit compile up yet).  Our ming64 for windows 32 can compile the 9.2 development branch but not the 9.1.3. Go figure.  Anyrate to make a long story short -- we have 32-bit binaries for PostgreSQL (you can use in VC++ builds) and 64-bit binaries as well that you can use for the VC++ EDB builds for those who are interested in experimenting.
&lt;a href=&quot;/downloads/fdw_win32_91_bin.zip&quot;&gt;PostgreSQL 9.1 Windows 32-bit ODBC FDW&lt;/a&gt; &amp;#160;&amp;#160;&lt;a href=&quot;/downloads/odbc_fdw_win64bin.zip&quot;&gt;PostgreSQL 9.1 Windows 64-bit ODBC FDW&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So far we&#039;ve tried the PostgreSQL 64-bit data wrapper against a SQL Server 2005 DSN and it seems to work fine.  Have yet to try it on other ODBC sources.
We&#039;ll write up a more detailed article describing how to make the connections.&lt;/p&gt;

&lt;p&gt;There is one trick to getting Mingw64 compiled PostgreSQL extensions to work with the Windows 64-bit EDB builds, and that is that when you compile your PostgreSQL under mingw64,
you have to configure with option &lt;code&gt;----disable-float8-byval&lt;/code&gt; as we noted in our &lt;a href=&quot;http://trac.osgeo.org/postgis/wiki/DevWikiWinMingW64&quot; target=&quot;_blank&quot;&gt;PostGIS Window 64 build instructions&lt;/a&gt;.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 27 Mar 2012 16:30:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/246-guid.html</guid>
    <category>fdw</category>
<category>foreign data wrapper</category>
<category>postgresql 9.1</category>

</item>

</channel>
</rss>