<?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>Magnus Hagander's PostgreSQL blog (Entries tagged as 9.1)</title>
    <link>http://blog.hagander.net/</link>
    <description></description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.6.2 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Extensions in PostgreSQL 9.1 fixes another pet-peeve</title>
    <link>http://blog.hagander.net/archives/193-Extensions-in-PostgreSQL-9.1-fixes-another-pet-peeve.html</link>
            <category>PostgreSQL</category>
    
    <comments>http://blog.hagander.net/archives/193-Extensions-in-PostgreSQL-9.1-fixes-another-pet-peeve.html#comments</comments>
    <wfw:comment>http://blog.hagander.net/wfwcomment.php?cid=193</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.hagander.net/rss.php?version=2.0&amp;type=comments&amp;cid=193</wfw:commentRss>
    

    <author>nospam@example.com (Magnus Hagander)</author>
    <content:encoded>
    &lt;p&gt;One thing I&#039;ve really disliked is the fact that contrib modules had installation scripts that enforced the schema to public for the installation. In my opinion, for no useful reason at all.&lt;/p&gt;

&lt;p&gt;For example, I often install the &lt;i&gt;pgcrypto&lt;/i&gt; contrib module. And I install this in the &lt;i&gt;pgcrypto&lt;/i&gt; schema, that I then either add to the &lt;i&gt;search_path&lt;/i&gt; variable or just explicitly use in my queries, with things like &lt;i&gt;pcrypto.crypt(&#039;foobar&#039;,&#039;barfoo&#039;)&lt;/i&gt;. For versions prior to 9.1, being able to do this required me to manually edit the installed pgcrypto.sql file, to remove the &lt;i&gt;SET search_path = public;&lt;/i&gt; command.&lt;/p&gt;

&lt;p&gt;Extensions in 9.1 makes this so much nicer. To get pgcrypto into it&#039;s own schema, I now just need to do:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;postgres=# CREATE SCHEMA pgcrypto;
CREATE SCHEMA
postgres=# CREATE EXTENSION pgcrypto SCHEMA pgcrypto;
CREATE EXTENSION&lt;/code&gt;&lt;/pre&gt;

If I happen to create it in public by mistake, I can even move it after the fact!
&lt;pre&gt;&lt;code&gt;postgres=# ALTER EXTENSION pgcrypto SET SCHEMA pgcrypto;
ALTER EXTENSION&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You still need to create the schema manually - in theory we could auto-create that, but the work is still a lot easier than before. And fully supported!&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Mon, 16 May 2011 07:58:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.hagander.net/archives/193-guid.html</guid>
    <category>9.1</category>
<category>extensions</category>
<category>pgcrypto</category>
<category>postgresql</category>

</item>
<item>
    <title>Remote log reading in PostgreSQL 9.1</title>
    <link>http://blog.hagander.net/archives/192-Remote-log-reading-in-PostgreSQL-9.1.html</link>
            <category>PostgreSQL</category>
    
    <comments>http://blog.hagander.net/archives/192-Remote-log-reading-in-PostgreSQL-9.1.html#comments</comments>
    <wfw:comment>http://blog.hagander.net/wfwcomment.php?cid=192</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blog.hagander.net/rss.php?version=2.0&amp;type=comments&amp;cid=192</wfw:commentRss>
    

    <author>nospam@example.com (Magnus Hagander)</author>
    <content:encoded>
    &lt;p&gt;PostgreSQL 9.1 beta1 &lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/www.postgresql.org/about/news.1313&#039;]);&quot;  href=&quot;http://www.postgresql.org/about/news.1313&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;now available&lt;/a&gt; - now is a great time to start testing it, and trying out all the great new features.&lt;/p&gt;

&lt;p&gt;There have always been a number of ways to read your PostgreSQL logs remotely, over a libpq connection. For example, you can use the &lt;i&gt;pg_read_file()&lt;/i&gt; function - which is what pgadmin does. PostgreSQL 9.1 adds a new and more convenient way (in some ways) to do this - using SQL/MED.&lt;/p&gt;

&lt;p&gt;PostgreSQL 9.1 comes with SQL standard SQL/MED functionality. The MED in is short for &quot;Managemend of External Data&quot;, and as the name sounds, it&#039;s about accessing data that&#039;s external to the PostgreSQL server. The SQL/MED functionality is not (yet) complete, but it&#039;s already very useful in it&#039;s current state.&lt;/p&gt;

&lt;p&gt;In SQL/MED, there is something called a &lt;i&gt;Foreign Data Wrapper&lt;/i&gt;, that can be compared to a driver. Using this &lt;i&gt;FDW&lt;/i&gt;, we can create one or more &lt;i&gt;Foreign Servers&lt;/i&gt;, which is a definition of how to connect to a specific instance of the service - if any. Finally, we can create one or more &lt;i&gt;Foreign Tables&lt;/i&gt; on each of the &lt;i&gt;Foreign Servers&lt;/i&gt;, giving us direct access to the remote data using SQL.&lt;/p&gt;

 &lt;br /&gt;&lt;a href=&quot;http://blog.hagander.net/archives/192-Remote-log-reading-in-PostgreSQL-9.1.html#extended&quot;&gt;Continue reading &quot;Remote log reading in PostgreSQL 9.1&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 02 May 2011 19:05:00 +0000</pubDate>
    <guid isPermaLink="false">http://blog.hagander.net/archives/192-guid.html</guid>
    <category>9.1</category>
<category>extensions</category>
<category>fdw</category>
<category>logging</category>
<category>postgresql</category>

</item>

</channel>
</rss>