<?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 - beginner</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>Fri, 20 Jan 2012 11:09:34 GMT</pubDate>

    <image>
        <url>http://www.postgresonline.com/journal/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Postgres OnLine Journal - beginner - 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>Table Inheritance and the tableoid</title>
    <link>http://www.postgresonline.com/journal/archives/240-Table-Inheritance-and-the-tableoid.html</link>
            <category>8.2</category>
            <category>8.3</category>
            <category>8.4</category>
            <category>9.0</category>
            <category>9.1</category>
            <category>9.2</category>
            <category>beginner</category>
            <category>q&amp;a</category>
    
    <comments>http://www.postgresonline.com/journal/archives/240-Table-Inheritance-and-the-tableoid.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=240</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;If I could name a number one feature I love most about PostgreSQL, it&#039;s the table inheritance feature which we described in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/59-How-to-Inherit,-Unherit-and-Merge-Inherit.html&quot; target=&quot;_blank&quot;&gt;How to Inherit and Uninherit&lt;/a&gt;. A lot of people use it for table partitioning using &lt;a href=&quot;http://www.postgresonline.com/journal/archives/27-Reading-PgAdmin-Graphical-Explain-Plans.html&quot; target=&quot;_blank&quot;&gt;CONSTRAINT EXCLUSION&lt;/a&gt;.  Aside from that, in combination with PostgreSQL schema search_path (customizable by user and/or database) it makes for a very flexible abstraction tool.  For example, for many of our web apps that service many departments where each department/client wants to keep a high level of autonomy, we have a schema set aside for each 
that inherits from a master template schema.  Each department site uses a different set of accounts with the primary schema being that of the department/client so that they are hitting their own  tables. &lt;/p&gt;
&lt;p&gt;Inheritance allows us to keep data separate,do roll-up reports if we need to, use the same application front-end, and yet allows us the ability to add new columns in just one place (the master template schema).  It is more flexible than other approaches because for example we may have a city organization that need to share tables, like for example a system loaded list of funding source shared across the agency.  We can set aside these shared tables in a separate schema visible to all or have some have their own copy they can change if they don&#039;t want to use the shared one.&lt;/p&gt;

&lt;p&gt;Every once in a while, we find ourselves needing to query the whole hierarchy and needing to know which table the results of the query are coming from. To help
solve that issue, we employ the use of the system column &lt;b&gt;tableoid&lt;/b&gt; which all user tables have. The tableoid is the the object id of a table.  PostgreSQL has many system columns that you have to explicitly select
and can&#039;t be accessed with a SELECT * with the tableoid being one of them.  These are: tableoid, cmax,cmin, xmin,xmax,ctid which are all described in &lt;a href=&quot;http://www.postgresql.org/docs/9.1/static/ddl-system-columns.html&quot; target=&quot;_blank&quot;&gt;System Columns&lt;/a&gt;.  The &lt;a href=&quot;http://www.postgresql.org/docs/9.1/static/ddl-inherit.html&quot; target=&quot;_blank&quot;&gt;PostgreSQL docs on inheritance&lt;/a&gt; have examples of using it, but we thought it worthwile to repeat the exercise since it&#039;s not that common knowledge and is unique enough feature of PostgreSQL that others coming from other relational databases, may miss the treat.  I&#039;ve often demonstrated
it to non-PostgreSQL users who use for example SQL Server or MySQL, and they literally fall out of their chair when I show the feature to them and its endless possibilities.&lt;/p&gt;   &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/240-Table-Inheritance-and-the-tableoid.html#extended&quot;&gt;Continue reading &quot;Table Inheritance and the tableoid&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 16 Jan 2012 05:52:54 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/240-guid.html</guid>
    
</item>
<item>
    <title>How big is my database and my other stuff</title>
    <link>http://www.postgresonline.com/journal/archives/233-How-big-is-my-database-and-my-other-stuff.html</link>
            <category>beginner</category>
            <category>q&amp;a</category>
    
    <comments>http://www.postgresonline.com/journal/archives/233-How-big-is-my-database-and-my-other-stuff.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=233</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;In this day and age of clouds and what not, it is still important to keep tabs on your database growth to ensure it doesn&#039;t
outgrow your disks or so that you can be prepared when it does.  A common question that is asked is how big your database is or all your databases combined.
Luckily PostgreSQL has had for a long time functions to help you answer this easily.  In this little article,
I&#039;ll demonstrate how to answer these questions and more with some PostgreSQL built-in functions&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/233-How-big-is-my-database-and-my-other-stuff.html#extended&quot;&gt;Continue reading &quot;How big is my database and my other stuff&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 21 Nov 2011 01:59:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/233-guid.html</guid>
    <category>postgresql</category>

</item>
<item>
    <title>How to create an n-column table really fast</title>
    <link>http://www.postgresonline.com/journal/archives/230-How-to-create-an-n-column-table-really-fast.html</link>
            <category>8.4</category>
            <category>9.0</category>
            <category>9.1</category>
            <category>9.2</category>
            <category>beginner</category>
            <category>postgresql versions</category>
            <category>q&amp;a</category>
    
    <comments>http://www.postgresonline.com/journal/archives/230-How-to-create-an-n-column-table-really-fast.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=230</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;Ever have the need to create a holding table say spreadsheet data with say 100 columns. You need to create a table to hold this stuff.   Or perhaps you were feeling in a sadist mood and wanted to abuse your PostgreSQL database to see how many columns you can create in a table of a specific data type. 
Here is a quick script to do it:&lt;/p&gt;

&lt;code&gt;
&lt;pre&gt;&lt;span class=&quot;syntax0&quot;&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;8.4+&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;syntax&lt;/span&gt;
&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;CREATE&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;TABLE&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;data_import(&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;
&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;syntax-FUNCTION&quot;&gt;array_to_string&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-FUNCTION&quot;&gt;array_agg&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;field&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; i&lt;span class=&quot;syntax-OPERATOR&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;varchar(255)&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;, &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;
&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;syntax-FUNCTION&quot;&gt;generate_series&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;syntax-DIGIT&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;As&lt;/span&gt; i;

&lt;span class=&quot;syntax-COMMENT1&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;9.0+&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;syntax&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;(string_agg&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;was&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;introduced&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;9.0)&lt;/span&gt;
&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;CREATE&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;TABLE&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;data_import(&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;
&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;syntax-FUNCTION&quot;&gt;string_agg&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;field&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; i&lt;span class=&quot;syntax-OPERATOR&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;varchar(255)&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;, &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;
&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;syntax-FUNCTION&quot;&gt;generate_series&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;syntax-DIGIT&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;As&lt;/span&gt; i;
&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Both variants will return output that looks like this: &lt;/p&gt;
&lt;pre&gt;&lt;span class=&quot;syntax0&quot;&gt;&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;syntax-FUNCTION&quot;&gt;data_import&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;field1 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;,field2 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;,field3 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;,field4 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;
    ,field5 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;,field6 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;,field7 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;
    ,field8 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;,field9 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;,field10 &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;varchar&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Now if you want it to also execute because you are running it as part of an sql script, you could wrap it in an anonymous function.&lt;/p&gt;
&lt;code&gt;
&lt;pre&gt;&lt;span class=&quot;syntax0&quot;&gt; &lt;span class=&quot;syntax-COMMENT1&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;-wrap&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;an&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;anonymous&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;run&lt;/span&gt;
 &lt;span class=&quot;syntax-COMMENT1&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;requires&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;PostgreSQL&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;9.0+&lt;/span&gt;
DO language &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;plpgsql&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;
$$
&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;DECLARE&lt;/span&gt; var_sql &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;text&lt;/span&gt; :&lt;span class=&quot;syntax-OPERATOR&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;CREATE&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;TABLE&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;data_import(&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;
    &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;syntax-FUNCTION&quot;&gt;string_agg&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;field&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; i&lt;span class=&quot;syntax-OPERATOR&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;varchar(255)&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;, &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;
    &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;syntax-FUNCTION&quot;&gt;generate_series&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;syntax-DIGIT&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;As&lt;/span&gt; i;
&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;BEGIN&lt;/span&gt;
    &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;EXECUTE&lt;/span&gt; var_sql;
&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;END&lt;/span&gt;;
$$ ;
&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;
 
    </content:encoded>

    <pubDate>Tue, 01 Nov 2011 22:31:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/230-guid.html</guid>
    <category>aggregates</category>
<category>array</category>
<category>array_agg</category>
<category>string_agg</category>

</item>
<item>
    <title>SQL Server to PostgreSQL: Converting table structure</title>
    <link>http://www.postgresonline.com/journal/archives/219-SQL-Server-to-PostgreSQL-Converting-table-structure.html</link>
            <category>basics</category>
            <category>beginner</category>
            <category>oracle</category>
            <category>plpgsql</category>
            <category>sql server</category>
    
    <comments>http://www.postgresonline.com/journal/archives/219-SQL-Server-to-PostgreSQL-Converting-table-structure.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=219</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;We&#039;ve been working on converting some of our SQL Server apps to PostgreSQL.   In this
article we&#039;ll describe some things to watch out for and provide a function we wrote to automate some of
the conversion.&lt;/p&gt;

&lt;p&gt;Although both databases are fairly ANSI-SQL compliant, there are still differences 
with their CREATE TABLE statements, data types, and how they handle other things that makes porting applications not so trivial. &lt;/p&gt;
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/219-SQL-Server-to-PostgreSQL-Converting-table-structure.html#extended&quot;&gt;Continue reading &quot;SQL Server to PostgreSQL: Converting table structure&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 04 Sep 2011 00:33:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/219-guid.html</guid>
    <category>migration</category>
<category>oracle</category>
<category>regular expressions</category>
<category>sql server</category>

</item>
<item>
    <title>Querying table, view, column and function descriptions</title>
    <link>http://www.postgresonline.com/journal/archives/215-Querying-table,-view,-column-and-function-descriptions.html</link>
            <category>beginner</category>
            <category>postgis</category>
            <category>q&amp;a</category>
    
    <comments>http://www.postgresonline.com/journal/archives/215-Querying-table,-view,-column-and-function-descriptions.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=215</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;One of the biggest complaints about software and perhaps even more specifically FLOSS software is the lack of documentation. I&#039;m not talking about those 
small little dialogs we throw in our code that rarely see the light of day.  I&#039;m talking about stuff you throw in user docs or specifications and so forth
that an analyst or end-user reads.&lt;/p&gt;
&lt;p&gt;The main reasons for this lack of documentation is that while everyone seems to want documentation, few really want to pay for it, and it&#039;s time consuming to keep 
documentation in synch with what the software actually does.  Having documentation that is very inconsistent with the software is worse than not having any documentation at all. 
A good way to keep documentation up to date is to fold it into the process of developing and testing the software such that changes in software expose errors in the documentation and vice-versa
or that the act of changing the software corrects the documentation.&lt;/p&gt;
&lt;p&gt;Part of the way we try to do that on the PostGIS project is to require each function patch to include documentation.  We also try to make our documentation executable 
by auto-generating PostgreSQL help and 
some test suites  from the documentation.  For example the process of installing documentation-generated function and type descriptions 
in PostgreSQL catches inconsistencies between
the implementation and what we actually publish about how the functions work.  Even the image generator that builds most of the images in the manual is built with PostGIS as a core of it
so that when our build-bot is rebuilding the documentation it is exercising some PostGIS output functions.&lt;/p&gt;

&lt;p&gt;I can&#039;t tell you how many times I&#039;ve flagged changes in the current PostGIS 2.0 release
simply by trying to install the docbook generated PostgreSQL comment descriptions and PostgreSQL complains that the function signature no longer exists that the documentations says should be there. 
So then I go back and correct
the documentation or yell at the programmer if the documentation makes more sense than what they coded. On the other side,
its easy to catch what we neglected to document simply by scanning the functions in PostgreSQL and seeing which ones don&#039;t have descriptions.  &lt;/p&gt;

&lt;p&gt;Okay as far as databases goes, many a DB Programmer/Analyst has waltzed into a project only to be befuddled about the meanings of all these tables used by the application.
If you are like us, you don&#039;t even want to look at any database documentation that is not part of the definition of the database because you know 99% of the time it&#039;s so obsolete 
or was just a pipe dream of someone working in a vacuum
that its more useless than not having any 
documentation at all. It is nice to have nicely formatted documentation you can read separate from the code, 
but even sweeter if you can query the documentation just as easily as you can query the data. &lt;/p&gt; 
&lt;p&gt;A good way of having up to date documentation is to weave it in as part of the process of defining the structure.  For databases
this means using foreign keys, primary keys, and using the commenting features that most relational databases offer these days.  For example the databases we commonly work with,
PostgreSQL, SQL Server, MS Access, and even MySQL all allow you to provide descriptions for tables, table columns, and sometimes other objects such as functions and stored procs right in the database.  PostgreSQL even allows you to provide descriptions of columns in
views though that&#039;s a bit messier to do.  Sadly there isn&#039;t a consistent way of pulling these descriptions out of the database that will work for all of these.  Each has differently defined meta tables it stores these descriptions in.
For thise article, we&#039;ll demonstrate how to pull this information from PostgreSQL.&lt;/p&gt;

&lt;p&gt;PostgreSQL does offer many useful switches in psql for querying this data, but we&#039;ll focus our attention on pulling this data via SQL. It&#039;s much easier to incorporate this information
in auto-generated documentation with SQL  because you can have more control what you include and how to format it.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/215-Querying-table,-view,-column-and-function-descriptions.html#extended&quot;&gt;Continue reading &quot;Querying table, view, column and function descriptions&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 31 Jul 2011 05:07:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/215-guid.html</guid>
    <category>postgis documentation</category>

</item>
<item>
    <title>Navigating PostgreSQL 9.1 beta 1 with PgAdmin III 1.14.0 Beta 1</title>
    <link>http://www.postgresonline.com/journal/archives/206-Navigating-PostgreSQL-9.1-beta-1-with-PgAdmin-III-1.14.0-Beta-1.html</link>
            <category>9.1</category>
            <category>basics</category>
            <category>beginner</category>
            <category>pgadmin</category>
            <category>postgis</category>
    
    <comments>http://www.postgresonline.com/journal/archives/206-Navigating-PostgreSQL-9.1-beta-1-with-PgAdmin-III-1.14.0-Beta-1.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=206</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;We&#039;ve started to play with PostgreSQL 9.1beta and the PgAdmin III 1.14.0 Beta 1.  We&#039;ll briefly go over the cool gems 
found in PgAdmin III beta 1.  Most of the new features are for navigating the upcoming PostgreSQL 9.1.  Well first obstacle we ran into
was we can&#039;t get our favorite extension, PostGIS, to compile against PostgreSQL 9.1beta though it did with the alphas, so you won&#039;t be seeing any windows experimental builds until we resolve this issue.
Details of ticket here? &lt;a href=&quot;http://trac.osgeo.org/postgis/ticket/940&quot; target=&quot;_blank&quot;&gt;PostGIS 2.0 won&#039;t compile for  PostgreSQL 9.1 beta1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Despite that minor set back, we decided to push on and navigate the new features by using PgAdmin III 1.14.0 as our Tour Guide. Below is a list of new features you can experience
via PgAdmin III 1.14.0 Beta 1.  I&#039;m sure there are more we missed, but these are the ones that were most flashing.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/206-Navigating-PostgreSQL-9.1-beta-1-with-PgAdmin-III-1.14.0-Beta-1.html#extended&quot;&gt;Continue reading &quot;Navigating PostgreSQL 9.1 beta 1 with PgAdmin III 1.14.0 Beta 1&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 06 May 2011 23:45:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/206-guid.html</guid>
    <category>pgadmin</category>
<category>postgresql 9.1</category>
<category>sql med</category>

</item>
<item>
    <title>An almost idiot's guide to Install PostgreSQL 9.0 with Yum</title>
    <link>http://www.postgresonline.com/journal/archives/203-An-almost-idiots-guide-to-Install-PostgreSQL-9.0-with-Yum.html</link>
            <category>9.0</category>
            <category>basics</category>
            <category>beginner</category>
            <category>postgresql versions</category>
            <category>yum</category>
    
    <comments>http://www.postgresonline.com/journal/archives/203-An-almost-idiots-guide-to-Install-PostgreSQL-9.0-with-Yum.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=203</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;In this exercise, we&#039;ll go thru installing PostgreSQL 9.0 on a Cent OS 5.5 32-bit box. This I&#039;m testing on a GoGrid Cloud server so I can do parallel benchmarks between my windows GoGrid
and Linux GoGrid server.&lt;/p&gt;

&lt;h4&gt;Upgrading from PostgreSQL 8.* to PostgreSQL 9.0&lt;/h4&gt;
&lt;p&gt;If you are upgrading from a PostgreSQL 8.4 to PostgreSQL 9.0, please refer to Devrim&#039;s article: 
&lt;a href=&quot;http://people.planetpostgresql.org/devrim/index.php?/archives/50-Upgrading-from-8.4-to-9.0-on-Fedora-Red-Hat-CentOS-using-RPMs.html&quot; target=&quot;_blank&quot;&gt;Upgrading from 8.4 to 9.0 on Fedora / Red Hat / CentOS using RPMs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the rest of this article, we&#039;ll go over configuring your yum to use the PostgreSQL PGDG Yum repository managed by Devrim Gunduz, which has the latest and greatest of 
9.0 as well as the 9.1 latest development release. We&#039;ll also demonstrate how to have two instances of PostgreSQL running so you can experiment with the new features of
PostgreSQL 9.1 while reminiscing about the soon to be old-hat features of PostgreSQL 9.0.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/203-An-almost-idiots-guide-to-Install-PostgreSQL-9.0-with-Yum.html#extended&quot;&gt;Continue reading &quot;An almost idiot&#039;s guide to Install PostgreSQL 9.0 with Yum&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 18 Apr 2011 04:32:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/203-guid.html</guid>
    <category>yum cloud</category>

</item>
<item>
    <title>An Almost Idiot's Guide to Installing  PostGIS 1.5 on PostgreSQL 9.0 via Yum</title>
    <link>http://www.postgresonline.com/journal/archives/204-An-Almost-Idiots-Guide-to-Installing-PostGIS-1.5-on-PostgreSQL-9.0-via-Yum.html</link>
            <category>9.0</category>
            <category>basics</category>
            <category>beginner</category>
            <category>postgis</category>
            <category>postgresql versions</category>
            <category>yum</category>
    
    <comments>http://www.postgresonline.com/journal/archives/204-An-Almost-Idiots-Guide-to-Installing-PostGIS-1.5-on-PostgreSQL-9.0-via-Yum.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=204</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;In the past I have always chosen to compile my own PostGIS  because the GEOS library that came with the regular PostgreSQL yum install, was a bit antiquated. 
This has changed, so this time around I figured I&#039;d give it a go at using the Yum repository 1.5.2 release of PostGIS available via &lt;a href=&quot;http://www.pgrpms.org/news-packagelist.php&quot; target=&quot;_blank&quot;&gt;Yum Package List&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;Before you can follow these directions, make sure you have your PostgreSQL 9.0 setup via our &lt;a href=&quot;http://www.postgresonline.com/journal/archives/203-postgresql90-yum.html&quot; target=&quot;_blank&quot;&gt;An almost idiot&#039;s guide to Install PostgreSQL 9.0 with Yum&lt;/a&gt;.&lt;/p&gt;

&lt;div style=&#039;background-color:yellow&#039;&gt;&lt;a href=&quot;http://www.amazon.com/PostGIS-Action-Regina-Obe/dp/1935182269?&amp;camp=213293&amp;linkCode=wey&amp;tag=postgisus-20&amp;creative=388373&quot; target=&quot;_blank&quot;&gt;PostGIS in Action&lt;/a&gt; has started shipping from Amazon and we already have 3 positive reviews.  We are hoping to write another book sometime soon, but haven&#039;t decided yet on the topic.  Will definitely have something to do with databases and probably a lot of PostgreSQL in it.&lt;/div&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/204-An-Almost-Idiots-Guide-to-Installing-PostGIS-1.5-on-PostgreSQL-9.0-via-Yum.html#extended&quot;&gt;Continue reading &quot;An Almost Idiot&#039;s Guide to Installing  PostGIS 1.5 on PostgreSQL 9.0 via Yum&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 21 Apr 2011 02:02:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/204-guid.html</guid>
    <category>postgis</category>
<category>postgresql 9.0</category>
<category>yum</category>

</item>
<item>
    <title>An almost idiot's guide to Install and Upgrade to PostgreSQL 8.4 with Yum</title>
    <link>http://www.postgresonline.com/journal/archives/144-An-almost-idiots-guide-to-Install-and-Upgrade-to-PostgreSQL-8.4-with-Yum.html</link>
            <category>8.2</category>
            <category>8.3</category>
            <category>8.4</category>
            <category>basics</category>
            <category>beginner</category>
            <category>yum</category>
    
    <comments>http://www.postgresonline.com/journal/archives/144-An-almost-idiots-guide-to-Install-and-Upgrade-to-PostgreSQL-8.4-with-Yum.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=144</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;In this exercise, we&#039;ll go thru our steps for upgrading a Redhat Enterprise Linux 64-bit PostgreSQL
box from PostgreSQL 8.3 to PostgreSQL 8.4.  If you don&#039;t have any kind of PostgreSQL installed on your box,
you can skip the Upgrade step.&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;color:green&quot;&gt;UPDATE - since Devrim&#039;s move from Command prompt - he has started a new yum repository.  You may want to use
this one instead since it seems more up to date than the other. &lt;a href=&quot;http://yum.pgrpms.org/&quot; target=&quot;_blank&quot;&gt;http://yum.pgrpms.org/&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;span style=&quot;color:green&quot;&gt;UPDATE&lt;p&gt;We have instructions for &lt;a href=&quot;http://www.postgresonline.com/journal/archives/203-postgresql90-yum.html&quot; target=&quot;_blank&quot;&gt;installing PostgreSQL 9.0 via yum&lt;/a&gt;.&lt;/p&gt;&lt;/span&gt;

&lt;h4&gt;Updgrading from PostgreSQL 8.* to PostgreSQL 8.4&lt;/h4&gt;
&lt;p&gt;If you are starting from scratch -- just skip this section.&lt;/p&gt;
&lt;p&gt;If you are upgrading from 8.4.0 to 8.4.1 you can get away with a simple &lt;br /&gt;&lt;code&gt;yum update postgresql&lt;/code&gt;&lt;br /&gt; and skip the rest of this article.&lt;/p&gt;
&lt;p&gt;If you are upgrading from PostgreSQL 8.3 to 8.4, in theory you can use PgMigrator, but in practice,
particularly with a Yum install, you are bound to run into obstacles. If you are running an older version, you must dump and restore.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/144-An-almost-idiots-guide-to-Install-and-Upgrade-to-PostgreSQL-8.4-with-Yum.html#extended&quot;&gt;Continue reading &quot;An almost idiot&#039;s guide to Install and Upgrade to PostgreSQL 8.4 with Yum&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sat, 28 Nov 2009 04:48:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/144-guid.html</guid>
    
</item>
<item>
    <title>An Almost Idiot's Guide to PostgreSQL YUM</title>
    <link>http://www.postgresonline.com/journal/archives/45-An-Almost-Idiots-Guide-to-PostgreSQL-YUM.html</link>
            <category>basics</category>
            <category>beginner</category>
            <category>yum</category>
    
    <comments>http://www.postgresonline.com/journal/archives/45-An-Almost-Idiots-Guide-to-PostgreSQL-YUM.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=45</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;P&gt;First we&#039;d like to thank Devrim of &lt;a href=&quot;http://www.commandprompt.com&quot; target=_blank&gt;Command Prompt&lt;/a&gt; for working hard on making this new YUM repository available.  In this article we will go over using the new PostgreSQL YUM repository for Redhat Fedora, Enterprise Linux and CentOS distros that is available at &lt;a href=&quot;http://yum.pgsqlrpms.org/&quot; target=_blank&gt;http://yum.pgsqlrpms.org/&lt;/a&gt;. &lt;br /&gt;
&lt;span style=&quot;color:green&quot;&gt;UPDATE - since Devrim&#039;s move from Command prompt - he has started a new yum repository.  You may want to use
this one instead since it seems more up to date than the other. &lt;a href=&quot;http://yum.pgrpms.org/&quot; target=&quot;_blank&quot;&gt;http://yum.pgrpms.org/&lt;/a&gt;&lt;/span&gt;.
&lt;/P&gt;
&lt;P&gt;We are gearing the content of this article to the described user profile
	&lt;UL&gt;
		&lt;LI&gt;Person has SSH root access to their PostgreSQL box&lt;/LI&gt;
		&lt;LI&gt;Person is new to using Red Hat Linux&lt;/LI&gt;
		&lt;LI&gt;Person may be new to using Linux in general&lt;/LI&gt;
	&lt;/UL&gt;
&lt;/P&gt;

&lt;p&gt;&lt;span style=&quot;color:red&quot;&gt;NOTE:  We have a newer article on &lt;a href=&quot;http://www.postgresonline.com/journal/archives/144-An-almost-idiots-guide-to-Install-and-Upgrade-to-PostgreSQL-8.4-with-Yum.html&quot;&gt;Installing PostgreSQL 8.4 with Yum&lt;/a&gt; and an even newer one for PostgreSQL 9.0 
please refer to &lt;b&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/203-postgresql90-yum.html&quot; target=&quot;_blank&quot;&gt;Installing PostgreSQL 9.0 via Yum&lt;/a&gt;&lt;/b&gt;.  This old article is for PostgreSQL 8.3.&lt;/span&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/45-An-Almost-Idiots-Guide-to-PostgreSQL-YUM.html#extended&quot;&gt;Continue reading &quot;An Almost Idiot&#039;s Guide to PostgreSQL YUM&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 20 Apr 2008 03:30:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/45-guid.html</guid>
    <category>yum</category>

</item>
<item>
    <title>YUM 2: Almost Idiot's Guide to upgrade from PostgreSQL 8.3.1 to 8.3.3</title>
    <link>http://www.postgresonline.com/journal/archives/60-YUM-2-Almost-Idiots-Guide-to-upgrade-from-PostgreSQL-8.3.1-to-8.3.3.html</link>
            <category>basics</category>
            <category>beginner</category>
            <category>yum</category>
    
    <comments>http://www.postgresonline.com/journal/archives/60-YUM-2-Almost-Idiots-Guide-to-upgrade-from-PostgreSQL-8.3.1-to-8.3.3.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=60</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;div style=&#039;background-color:yellow&#039;&gt;UPDATE we have new instructions for PostgreSQL 9.0 -- refer to &lt;a href=&quot;http://www.postgresonline.com/journal/archives/203-postgresql90-yum.html&quot; target=&quot;_blank&quot;&gt;Installing PostgreSQL 9.0 via Yum&lt;/a&gt;&lt;/div&gt;
&lt;P&gt;In our April Issue &lt;a href=&quot;http://www.postgresonline.com/journal/archives/45-An-Almost-Idiots-Guide-to-PostgreSQL-YUM.html&quot; target=_blank&gt;An Almost Idiot&#039;s Guide to PostgreSQL YUM&lt;/a&gt; 
we covered using the new PostgreSQL Yum repository to install the PostgreSQL 8.3.1 release on Fedora, RedHat Enterprise, and CentOS.  We also received numerous useful feedback from others on issues they
ran into and how they overcame them.  The blog comments are definitely worth a read.&lt;/P&gt;

&lt;P&gt;Now that 8.3.3 has come out, many of you should be considering upgrading if you haven&#039;t already since there are a couple of bug fixes as outlined in 
&lt;a href=&quot;http://www.postgresql.org/docs/8.3/static/release-8-3-2.html&quot; target=_blank&gt;http://www.postgresql.org/docs/8.3/static/release-8-3-2.html&lt;/a&gt;, &lt;a href=&quot;http://www.postgresql.org/docs/8.3/static/release-8-3-3.html&quot; target=_blank&gt;http://www.postgresql.org/docs/8.3/static/release-8-3-3.html&lt;/a&gt;,
and for those running 8.3.0 you will need to reindex your tables after as noted in &lt;a href=&quot;http://www.postgresql.org/docs/8.3/static/release-8-3-1.html&quot; target=_blank&gt;http://www.postgresql.org/docs/8.3/static/release-8-3-1.html&lt;/a&gt;.  
If you are running version 8.3.1 and above then
this is a fairly painless upgrade that just requires you to backup your data as a precautionary measure, but doesn&#039;t require a dump reload.
&lt;/P&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/60-YUM-2-Almost-Idiots-Guide-to-upgrade-from-PostgreSQL-8.3.1-to-8.3.3.html#extended&quot;&gt;Continue reading &quot;YUM 2: Almost Idiot&#039;s Guide to upgrade from PostgreSQL 8.3.1 to 8.3.3&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 06 Jul 2008 06:34:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/60-guid.html</guid>
    
</item>
<item>
    <title>SQL Server 64-bit Linked Server woes</title>
    <link>http://www.postgresonline.com/journal/archives/196-SQL-Server-64-bit-Linked-Server-woes.html</link>
            <category>9.0</category>
            <category>basics</category>
            <category>beginner</category>
            <category>sql server</category>
    
    <comments>http://www.postgresonline.com/journal/archives/196-SQL-Server-64-bit-Linked-Server-woes.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=196</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;We were setting up another SQL Server 2005 64-bit where we needed a linked server connection to our PostgreSQL 9.0 server.  This is something we&#039;ve done before so not new and something we documented in  
&lt;a href=&quot;http://www.postgresonline.com/journal/archives/46-Setting-up-PostgreSQL-as-a-Linked-Server-in-Microsoft-SQL-Server-64-bit.html&quot; target=&quot;_blank&quot;&gt;Setting up PostgreSQL as a Linked Server in Microsoft SQL Server 64-bit&lt;/a&gt;.
What was different this time is that we decided to use the latest version of the new PostgreSQL 64-bit drivers now available main PostgreSQL site &lt;a href=&quot;http://www.postgresql.org/ftp/odbc/versions/msi/&quot; target=&quot;_blank&quot;&gt;http://www.postgresql.org/ftp/odbc/versions/msi/&lt;/a&gt;. 
Sadly these did not work for us.  They seemed to work fine in our MS Access 2010 64-bit install, but when used via SQL Server, SQL Server would choke with a message:&lt;/p&gt;

&lt;span style=&quot;color:red&quot;&gt;Msg 7350, Level 16, State 2, Line 1&lt;br /&gt;Cannot get the column information from OLE DB provider &quot;MSDASQL&quot;&lt;/span&gt; 
&lt;p&gt;If you tried to do a query with them.  You can however see all the tables via the linked server tab.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/196-SQL-Server-64-bit-Linked-Server-woes.html#extended&quot;&gt;Continue reading &quot;SQL Server 64-bit Linked Server woes&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 21 Feb 2011 19:10:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/196-guid.html</guid>
    <category>sql server</category>

</item>
<item>
    <title>Conditional Uniqueness with Partial Indexes</title>
    <link>http://www.postgresonline.com/journal/archives/195-Conditional-Uniqueness-with-Partial-Indexes.html</link>
            <category>8.2</category>
            <category>8.3</category>
            <category>8.4</category>
            <category>9.0</category>
            <category>9.1</category>
            <category>beginner</category>
            <category>postgresql versions</category>
            <category>q&amp;a</category>
            <category>sql server</category>
    
    <comments>http://www.postgresonline.com/journal/archives/195-Conditional-Uniqueness-with-Partial-Indexes.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=195</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;b&gt;Question&lt;/b&gt;&lt;p&gt;You have a system of products and categories and you want a product to be allowed to be in multiple categories, but you want a product to only be allowed to be in one main category.
How do you enforce this rule in the database?&lt;/p&gt;

&lt;p&gt;Some people will say -- why can&#039;t you just deal with this in your application logic. Our general reason is that much of our updating doesn&#039;t happen at our application level. We like enforcing rules at the database
level because it saves us from ourselves. We are in the business of massaging data.  For this particular kind of example we wanted to make sure the database would provide us a nice safety net so that 
we wouldn&#039;t accidentally assign a product in two main categories.&lt;/p&gt;

&lt;b&gt;Answer&lt;/b&gt;
&lt;p&gt;There are two approaches we thought of.  One is the obvious have a primary category column and a bridge table that has secondary categories.  That is an ugly solution because when you do a query you have to do a union
and always treat the secondary categories as different from the main.  For most use-cases we don&#039;t usually care about distinguisihing primary from secondary category.&lt;/p&gt;

&lt;p&gt;The solution we finally settled on was to have one bridge table with a boolean field for if its the main category.  We enforce the only one main category requirement using a partial index.  Now not all databases support partial indexes
This is one major value of using PostgreSQL that you have so many more options for implementing logic.  &lt;/p&gt;

&lt;div style=&quot;background-color:yellow&quot;&gt;As some people noted in the comments and the reddit entry.  SQL Server 2008 has a similar feature called Filtered Indexes.  Though PostgreSQL has had partial indexes for as far back as I can remember.  This brings up an interesting point which I have observed -- if you were using PostgreSQL before, you would already know how to use the Filtered Indexes, Multi row inserts introduced in SQL Server 2008, and the SEQUENCES feature coming in SQL Server 2010. So we should all use PostgreSQL, because it teaches us how to use the newer versions of SQL Server before they come out. :)&lt;/div&gt;

&lt;p&gt;So how does the partial index solution look:  NOTE for simplicity, we are leaving out all the complimentary tables and the foreign key constraints that we also have in place.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax0&quot;&gt;&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;TABLE&lt;/span&gt; products_categories
&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;
  category_id &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;integer&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;NOT&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;NULL&lt;/span&gt;,
  product_id &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;integer&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;NOT&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;NULL&lt;/span&gt;,
  main boolean &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;NOT&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;NULL&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;DEFAULT&lt;/span&gt; false,
  orderby &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;integer&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;NOT&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;NULL&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;DEFAULT&lt;/span&gt; &lt;span class=&quot;syntax-DIGIT&quot;&gt;0&lt;/span&gt;,
  &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;CONSTRAINT&lt;/span&gt; products_categories_pkey &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;PRIMARY&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;KEY&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;category_id, product_id&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;;

&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;UNIQUE&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;INDEX&lt;/span&gt; idx_products_categories_primary
  &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;ON&lt;/span&gt; products_categories
  USING btree
  &lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;product_id&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;WHERE&lt;/span&gt; main &lt;span class=&quot;syntax-OPERATOR&quot;&gt;=&lt;/span&gt; true;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Testing it out.  It saves us and gives us a nice informative message to boot.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax0&quot;&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;we&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;our&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;safety&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;net&lt;/span&gt;
&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;INTO&lt;/span&gt; &lt;span class=&quot;syntax-FUNCTION&quot;&gt;products_categories&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;category_id, product_id, main&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;syntax-KEYWORD1&quot;&gt;VALUES&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;syntax-DIGIT&quot;&gt;2&lt;/span&gt;,true&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;, &lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;3&lt;/span&gt;,&lt;span class=&quot;syntax-DIGIT&quot;&gt;2&lt;/span&gt;,false&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;, &lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;3&lt;/span&gt;,&lt;span class=&quot;syntax-DIGIT&quot;&gt;3&lt;/span&gt;,true&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;, &lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;4&lt;/span&gt;,&lt;span class=&quot;syntax-DIGIT&quot;&gt;2&lt;/span&gt;,true&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;;


&lt;span class=&quot;syntax-COMMENT1&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;which&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;gives&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;us&lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;syntax-COMMENT1&quot;&gt;error&lt;/span&gt;
&lt;span class=&quot;syntax-LABEL&quot;&gt;ERROR&lt;/span&gt;&lt;span class=&quot;syntax-LABEL&quot;&gt;:&lt;/span&gt;  duplicate &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;key&lt;/span&gt; value violates &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;unique&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;constraint&lt;/span&gt; &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;idx_products_categories_primary&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;syntax-LABEL&quot;&gt;DETAIL&lt;/span&gt;&lt;span class=&quot;syntax-LABEL&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;Key&lt;/span&gt; &lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;product_id&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt; already &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;exists&lt;/span&gt;.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Sat, 19 Feb 2011 23:12:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/195-guid.html</guid>
    
</item>
<item>
    <title>Reverse String Aggregation: Explode concatenated data into separate rows In PostgreSQL, SQL Server and MySQL</title>
    <link>http://www.postgresonline.com/journal/archives/193-Reverse-String-Aggregation-Explode-concatenated-data-into-separate-rows-In-PostgreSQL,-SQL-Server-and-MySQL.html</link>
            <category>beginner</category>
            <category>mysql</category>
            <category>postgresql versions</category>
            <category>q&amp;a</category>
            <category>sql server</category>
    
    <comments>http://www.postgresonline.com/journal/archives/193-Reverse-String-Aggregation-Explode-concatenated-data-into-separate-rows-In-PostgreSQL,-SQL-Server-and-MySQL.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=193</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;In our last article we talked about &lt;a href=&quot;http://www.postgresonline.com/journal/archives/191-stringagg.html&quot; target=&quot;_blank&quot;&gt;String Aggregation implementing in PostgreSQL, SQL Server, and MySQL&lt;/a&gt;.  This task is one that makes purist relational database programmers
a bit squeamish.  In this article we&#039;ll talk about the reverse of that, how do you deal with data that someone hands you delimeted in a single field and that you are asked to explode or re-sort based on some  lookup table.&lt;/p&gt;

&lt;p&gt;What are the benefits of having a structure such as? : &lt;pre&gt;&lt;code&gt;p_name |           activities
--------+--------------------------------
 Dopey  | Tumbling
 Humpty | Cracking;Seating;Tumbling
 Jack   | Fishing;Hiking;Skiing
 Jill   | Bear Hunting;Hiking
&lt;/code&gt;&lt;/pre&gt;Well for the casual programmer or simple text file database that knows nothing about JOINS and so forth, it makes it simple to pull a list of people who like Tumbling.
You simply do a WHERE &#039;;&#039; || activities || &#039;;&#039; LIKE &#039;%;Tumbling;%&#039;.  It&#039;s great for security too because you can determine security with a simple like check and also list all the security groups a member belongs in without doing anything.  
Quite easy for even the least data-skilled of programmers to work with because most procedural languages have a split function that can easily parse these into an array useful for stuffing into drop down lists and so forth. As a consultant of semi-techie people
I&#039;m often torn by the dilemma of &quot;What is the way I would program for myself vs. the way that provides the most autonomy to the client&quot;.  By that I mean
for example I try to avoid heavy-weight things like Wizards that add additional bloated dependencies or slow the speed down of an application. These bloated dependencies may provide ease to the client but make my debugging life harder. So I weight the options
and figure out which way works now and also provides me an easy escape route should things like speed or complexity become more of an issue.&lt;/p&gt;
&lt;p&gt;This brings us to the topic of, what is wrong with this model?  It can be slow because the LIKE condition you have can&#039;t easily take advantage of an index unless using a full text index so not ideal where this is the primary filtering factor.  It&#039;s also prone to pollution because
you can&#039;t easily validate that the values in the field are in your valid set of lookups or if your lookup changes, the text can be forced to change with a CASCADE UPDATE/DELETE RULE etc.  In cases where this is of minor consequence
which is many if referential integrity is not high on your list of requirements, this design is not bad.  It might make a purist throw up but oh well there is always dramamine to fall back on.  As long as you have done your cost benefit analysis, I don&#039;t think there should be any shame of following this
less than respected route.&lt;/p&gt;
&lt;p&gt;While you may despise this model, it has its place and it&#039;s a fact of life that one day someone will hand it to you and you may need to flip it around a bit.  We shall demonstrate how to do that in this article.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/193-Reverse-String-Aggregation-Explode-concatenated-data-into-separate-rows-In-PostgreSQL,-SQL-Server-and-MySQL.html#extended&quot;&gt;Continue reading &quot;Reverse String Aggregation: Explode concatenated data into separate rows In PostgreSQL, SQL Server and MySQL&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 18 Jan 2011 18:50:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/193-guid.html</guid>
    
</item>
<item>
    <title>Where is soundex and other warm and fuzzy string things</title>
    <link>http://www.postgresonline.com/journal/archives/158-Where-is-soundex-and-other-warm-and-fuzzy-string-things.html</link>
            <category>8.2</category>
            <category>8.3</category>
            <category>8.4</category>
            <category>9.0</category>
            <category>beginner</category>
            <category>contrib spotlight</category>
            <category>fuzzystrmatch</category>
            <category>mysql</category>
            <category>oracle</category>
            <category>postgresql versions</category>
            <category>sql server</category>
    
    <comments>http://www.postgresonline.com/journal/archives/158-Where-is-soundex-and-other-warm-and-fuzzy-string-things.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=158</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;For those people coming from Oracle, SQL Server and MySQL or other databases that have soundex functionality, 
you may be puzzled, or even frustrated when you try to do 
something like &lt;br /&gt;&lt;code&gt;WHERE soundex(&#039;Wushington&#039;) = soundex(&#039;Washington&#039;)&lt;/code&gt; 
&lt;br /&gt; in PostgreSQL and get a function does not exist error.&lt;/p&gt;

&lt;p&gt;Well it does so happen that there is a soundex function in PostgreSQL, and yes it is 
also called &lt;b&gt;soundex&lt;/b&gt;, but is offered as a contrib module and not installed by default. It also has other fuzzy  string matching functions in addition to soundex. 
One of my favorites, the &lt;b&gt;levenshenstein&lt;/b&gt; distance function is included as well.  In this article
we&#039;ll be covering the contrib module packaged as &lt;b&gt;fuzzystrmatch.sql&lt;/b&gt;. Details of the module can be found in &lt;a href=&quot;http://www.postgresql.org/docs/8.4/static/fuzzystrmatch.html&quot; target=&quot;_blank&quot;&gt;FuzzyStrMatch&lt;/a&gt;.
The contrib module has been around for sometime, but has changed slightly from PostgreSQL version to PostgreSQL version.  We are covering the 8.4 version in this article.&lt;/p&gt;

&lt;p&gt;For those unfamiliar with soundex, its a basic approach developed by the US Census in the 1930s as a way of sorting
names by pronounciation.  Read &lt;a href=&quot;http://www.fcgsc.org/forms/CensusAndSoundex.pdf&quot; target=&quot;_blank&quot;&gt;Census and Soundex&lt;/a&gt; for more gory history details.&lt;/p&gt;
&lt;p&gt;Given that it is an approach designed primarily for the English alphabet, it sort of makes sense why its not built-in to PostgreSQL,
which has more of a diverse international concern. For example if you used it to compare two words in Japanese or Chinese,
don&#039;t think it would fair too well in any of the database platforms that support this function.&lt;/p&gt;
&lt;p&gt;The original soundex algorithm has been improved over the years.  Though its still the most common used today, newer variants 
exist called &lt;a href=&quot;http://en.wikipedia.org/wiki/Metaphone&quot; target=&quot;_blank&quot;&gt;MetaPhone&lt;/a&gt; developed in the 1990s and &lt;a href=&quot;http://en.wikipedia.org/wiki/Double_Metaphone&quot; target=&quot;_blank&quot;&gt;Double Metaphone (DMetaPhone)&lt;/a&gt; developed in 2000 that support additional
consonants in other languages such as Slavic, Celtic, Italian, Spanish etc.  
These two variants are also included in the fuzzystrmatch contrib library.  The soundex function still seems to be 
the most popularly used at least for U.S. This is perhaps because most of the other databases (Oracle, SQL Server, MySQL) have soundex built-in but not the metaphone variants.
So in a sense soundex is a more portable function.  The other reason is that metaphone and dmetaphone take up a bit more space and
are also more processor intensive to compute than soundex. We&#039;ll demonstrate some differences between them in this article.&lt;/p&gt;

&lt;p&gt;To enable soundex and the other fuzzy string matching functions included, just run the 
&lt;b&gt;share/contrib/fuzzystrmatch.sql&lt;/b&gt; located in your PostgreSQL install folder.  This library is an important piece of arsenal for geocoding and genealogy tracking particularly
the U.S. streets and surnames data sets.  I come from a long line of Minors, Miners, Burnettes and Burnets.&lt;/p&gt;

&lt;p&gt;For the next set of exercises, we will be using the places dataset we created in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/157-Import-fixed-width-data-into-PostgreSQL-with-just-PSQL.html&quot; target=&quot;_blank&quot;&gt;Importing Fixed width data into PostgreSQL with just PSQL&lt;/a&gt;.&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/158-Where-is-soundex-and-other-warm-and-fuzzy-string-things.html#extended&quot;&gt;Continue reading &quot;Where is soundex and other warm and fuzzy string things&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 17 May 2010 16:53:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/158-guid.html</guid>
    <category>contrib</category>
<category>levenshtein</category>
<category>mysql</category>
<category>oracle</category>
<category>soundex</category>
<category>sql server</category>
<category>string matching</category>

</item>
<item>
    <title>PostgreSQL 9.0 pg_dump, pg_dumpall, pg_restore cheatsheet overview</title>
    <link>http://www.postgresonline.com/journal/archives/186-PostgreSQL-9.0-pg_dump,-pg_dumpall,-pg_restore-cheatsheet-overview.html</link>
            <category>9.0</category>
            <category>beginner</category>
            <category>special feature</category>
    
    <comments>http://www.postgresonline.com/journal/archives/186-PostgreSQL-9.0-pg_dump,-pg_dumpall,-pg_restore-cheatsheet-overview.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=186</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;Backup and Restore is probably the most important thing to know how to do when you have a database with data you care about.&lt;/p&gt;

&lt;p&gt;The utilities in PostgreSQL that accomplish these tasks are pg_restore, pg_dump, pg_dumpall, and for restore of plain text dumps - psql.  &lt;/p&gt;
&lt;p&gt;A lot of the switches used by pg_dump, pg_restore, pg_dumpall are common to all three.  You use pg_dump to do backups of a single database or select database objects and pg_restore to restore it either to another database or to recover portions of a database.  You use pg_dumpall to dump all your databases in plain text format.  &lt;/p&gt;

&lt;p&gt;Rather than trying to keep track of which switch works with which, we decided to combine all into a single cheat sheet with a column denoting which utility the switch is supported in.
Pretty much all the text is compiled from the --help switch of each.&lt;/p&gt;
&lt;P&gt;We created a similar &lt;a href=&quot;http://www.postgresonline.com/journal/archives/63-PostgreSQL-8.3-Pg_dump-Pg_Restore-Cheatsheet-Overview.html&quot; target=&quot;_blank&quot;&gt;Backup and Restore cheatsheet for PostgreSQL 8.3&lt;/a&gt; and since then some new features have been added such as the jobs parallel restore feature in 8.4.  We have now created an updated sheet to comprise all features present in PostgreSQL 9.0 packaged pg_dump, pg_restore, pg_dumpall command line utilities.
&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=postgresql90_pg_dumprestore_cheatsheet&amp;outputformat=pdf&quot; target=&quot;_blank&quot;&gt;PostgreSQL 9.0 Dump Restore 8.5 x 11&lt;/a&gt; and also available in
&lt;a href=&quot;/special_feature.php?sf_name=postgresql90_pg_dumprestore_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=postgresql90_pg_dumprestore_cheatsheet&amp;outputformat=html&quot; target=_blank&gt;HTML&lt;/a&gt;.
&lt;/P&gt;

&lt;p&gt;As usual please let us know if you find any errors or omissions and we&#039;ll be happy to correct.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 21 Nov 2010 20:35:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/186-guid.html</guid>
    <category>backup</category>
<category>pg_dump</category>
<category>pg_restore</category>
<category>pgadmin</category>
<category>postgresql 9.0</category>
<category>restore</category>

</item>
<item>
    <title>PostgreSQL 8.3 Pg_dump Pg_Restore Cheatsheet Overview</title>
    <link>http://www.postgresonline.com/journal/archives/63-PostgreSQL-8.3-Pg_dump-Pg_Restore-Cheatsheet-Overview.html</link>
            <category>beginner</category>
            <category>special feature</category>
    
    <comments>http://www.postgresonline.com/journal/archives/63-PostgreSQL-8.3-Pg_dump-Pg_Restore-Cheatsheet-Overview.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=63</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;Backup and Restore is probably the most important thing to know how to do when you have a database with data you care about.&lt;/p&gt;

&lt;p&gt;The utilities in PostgreSQL that accomplish these tasks are pg_restore, pg_dump, pg_dumpall, and for restore of plain text dumps - psql.&lt;/p&gt;
&lt;p&gt;A lot of the switches used by pg_dump, pg_restore, pg_dumpall are common to all three and on rare cases, the switches used by each overlap but mean different things.
pg_dump and pg_restore are complementary.  You use pg_dump to do hot backups of a database and pg_restore to restore it either to another database or to recover portions of a database.&lt;/p&gt;

&lt;p&gt;Rather than trying to keep track of which switch works with which, we decided to combine all into a single cheat sheet with a column denoting which utility the switch is supported in.
Pretty much all the text is compiled from the --help switch of each.&lt;/p&gt;
&lt;P&gt;Below is a Thumbnail view of the PostgreSQL 8.3 Dump Restore cheat sheet 
that covers PostgreSQL 8.3 pg_dump, pg_dumpall, pg_restore utilities. 
&lt;/P&gt;
&lt;a href=&quot;/special_feature.php?sf_name=postgresql83_pg_dumprestore_cheatsheet&amp;outputformat=html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;/images/journal/postgresql83_pg_dumprestore_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=postgresql83_pg_dumprestore_cheatsheet&amp;outputformat=pdf&quot; target=&quot;_blank&quot;&gt;PostgreSQL 8.3 Dump Restore 8.5 x 11&lt;/a&gt; and also available in
&lt;a href=&quot;/special_feature.php?sf_name=postgresql83_pg_dumprestore_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=postgresql83_pg_dumprestore_cheatsheet&amp;outputformat=html&quot; target=_blank&gt;HTML&lt;/a&gt;.
&lt;/P&gt; 
    </content:encoded>

    <pubDate>Sun, 27 Jul 2008 20:09:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/63-guid.html</guid>
    <category>backup</category>
<category>pg_dump</category>
<category>postgresql 8.3</category>
<category>restore</category>

</item>
<item>
    <title>greatest and least - oldies but goodies</title>
    <link>http://www.postgresonline.com/journal/archives/183-greatest-and-least-oldies-but-goodies.html</link>
            <category>8.2</category>
            <category>beginner</category>
            <category>mysql</category>
            <category>oracle</category>
            <category>other dbms</category>
            <category>q&amp;a</category>
            <category>sql server</category>
    
    <comments>http://www.postgresonline.com/journal/archives/183-greatest-and-least-oldies-but-goodies.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=183</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;h4&gt;Problem: You have a set of numbers, or characters or whatever and you are trying to find the max or min of this set?&lt;/h4&gt;
&lt;p&gt;If the values are separate records in a table or query, the answer is well known and respected across all relational databases -- use the aggregate MAX and MIN functions.&lt;/p&gt;
&lt;p&gt;But what if you have a set of free wheeling numbers or text not in separate records, and you want the max or min of each.  Here is where the 
&lt;strong&gt;least&lt;/strong&gt; and &lt;strong&gt;greatest&lt;/strong&gt; functions come in handy.  &lt;/p&gt;
&lt;p&gt;PostgreSQL has had these functions for as far back as I can remember and  is not the only database to sport these marvelous functions.  Our beloved MySQL and Oracle database have these functions as well. Sadly our more beloved SQL Server even in the SQL Server 2008
variant - lacks these functions.&lt;/p&gt;


&lt;p&gt;Okay how to use these functions -- you use it like this: 
&lt;code&gt;
&lt;pre&gt;
   &lt;span class=&quot;syntax0&quot;&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;syntax-FUNCTION&quot;&gt;least&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;syntax-OPERATOR&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;syntax-DIGIT&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;syntax-DIGIT&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;As&lt;/span&gt; num_least, &lt;span class=&quot;syntax-FUNCTION&quot;&gt;greatest&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;Bobby&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;, &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;Catty&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;, &lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;Kitty&lt;/span&gt;&lt;span class=&quot;syntax-LITERAL1&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;syntax-OPERATOR&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-KEYWORD1&quot;&gt;As&lt;/span&gt; greatest_cat;&lt;/span&gt;
    
    Yields:
 num_least| greatest_cat
----------+----------
       -2 | Kitty
&lt;/pre&gt;
&lt;/code&gt;

&lt;p&gt;We would classify these functions along the lines of COALESCE.  They are like COALESCE because they take an arbitrary number of arguments and the datatype that is returned
is highest datatype that all arguments in the function can be autocast to.  If there is no autocast then well you get an error. To demonstrate, guess what happens when you do this:
&lt;/p&gt;

&lt;code&gt;SELECT least(-1, &#039;Kitty&#039;);&lt;/code&gt;

&lt;p&gt;Well do this in PostgreSQL at least in 8.3+, you get a nice slap if you haven&#039;t installed any deprecated autocasts: &lt;/p&gt;
&lt;span style=&quot;color:red&quot;&gt;ERROR:  invalid input syntax for integer: &quot;Kitty&quot;
LINE 1: SELECT least(&#039;Kitty&#039;, -1)&lt;/span&gt;

&lt;p&gt;Do this in MySQL - so friendly and forgiving, and great reader of minds and you get: &lt;/p&gt;
&lt;code&gt;-1&lt;/code&gt;
&lt;br /&gt;
&lt;strong&gt;OF COURSE&lt;/strong&gt;

&lt;p&gt;I apologize for the ambiguous sarcasm, its just sometimes I want my mind read and sometimes I don&#039;t and I just can&#039;t figure out whether today is one of those days or the other day.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Fri, 05 Nov 2010 01:50:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/183-guid.html</guid>
    <category>ansi sql</category>
<category>mysql</category>
<category>oracle</category>
<category>sql server</category>

</item>
<item>
    <title>TSearch Primer</title>
    <link>http://www.postgresonline.com/journal/archives/34-TSearch-Primer.html</link>
            <category>beginner</category>
            <category>contrib spotlight</category>
            <category>tsearch</category>
    
    <comments>http://www.postgresonline.com/journal/archives/34-TSearch-Primer.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=34</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;h4&gt;What is TSearch?&lt;/h4&gt;
&lt;P&gt;TSearch is a Full-Text Search engine that is packaged with PostgreSQL. The key developers of TSearch are Oleg Bartunov and Teodor Sigaev who have also done extensive
work with GiST and GIN indexes used by PostGIS, PgSphere and other projects.  For more about how TSearch and OpenFTS got started check out &lt;a href=&quot;http://www.sai.msu.su/~megera/postgres/fts/doc/fts-history.html&quot; target=_blank&gt;A Brief History of FTS in PostgreSQL&lt;/a&gt;. 
Check out the &lt;a href=&quot;http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/&quot; target=_blank&gt;TSearch Official Site&lt;/a&gt; if you are interested in related TSearch tips or interested in donating to this very worthy project.&lt;/P&gt;

&lt;P&gt;Tsearch is different from regular string searching in 
PostgreSQL in a couple of key ways.

&lt;OL&gt;
	&lt;LI&gt;It is well-suited for searching large blobs of text since each word is indexed using a Generalized Inverted Index (GIN) or Generalized Search Tree (GiST) and searched using text search vectors. GIN is generally used for indexing. Search vectors
	are at word and phrase boundaries.&lt;/LI&gt;
	&lt;LI&gt;TSearch has a concept of Linguistic significance using various language dictionaries, ISpell, thesaurus, stop words, etc. therefore it can ignore common words and
		equate like meaning terms and phrases.&lt;/LI&gt;
	&lt;LI&gt;TSearch is for the most part case insensitive.&lt;/LI&gt;
	&lt;LI&gt;While various dictionaries and configs are available out of the box with TSearch, one can create new ones and customize existing further to 
	cater to specific niches within industries - e.g. medicine, pharmaceuticals, physics, chemistry, biology, legal matters.&lt;/LI&gt;
&lt;/OL&gt;
&lt;/P&gt;
&lt;P&gt;
Prior to PostgreSQL 8.3, it was a contrib module
located in the shared/contribs folder.  As of PostgreSQL 8.3 it is now fully integrated into the PostgreSQL core.
The official documents for using TSearch in 8.3 are located in
&lt;a href=&quot;http://www.postgresql.org/docs/8.3/static/textsearch.html&quot; target=&quot;_blank&quot;&gt;Chapter 12. Full Text Search&lt;/a&gt; of the official
PostgreSQL documentation.  &lt;/P&gt;

&lt;P&gt;In this article we shall provide a quick primer to using TSearch in 8.3.  
In the next month&#039;s issue of the Postgres OnLine Journal we shall provide a TSearch cheat sheet similar to our &lt;a href=&quot;http://www.postgresonline.com/journal/archives/17-PostgreSQL-8.3-Cheat-Sheet-Overview.html&quot; target=_blank&gt;PostgreSQL 8.3 cheat sheet&lt;/a&gt;.&lt;/P&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/34-TSearch-Primer.html#extended&quot;&gt;Continue reading &quot;TSearch Primer&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 29 Feb 2008 12:19:00 -0500</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/34-guid.html</guid>
    
</item>
<item>
    <title>PgAdmin III 1.13 - change in plugin architecture and PostGIS Plugins</title>
    <link>http://www.postgresonline.com/journal/archives/180-PgAdmin-III-1.13-change-in-plugin-architecture-and-PostGIS-Plugins.html</link>
            <category>9.1</category>
            <category>basics</category>
            <category>beginner</category>
            <category>gis</category>
            <category>oracle</category>
            <category>pgadmin</category>
            <category>postgis</category>
    
    <comments>http://www.postgresonline.com/journal/archives/180-PgAdmin-III-1.13-change-in-plugin-architecture-and-PostGIS-Plugins.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=180</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;One of the neat changes already present in the PgAdmin III 1.13dev, is the change in plugin architecture.  Version 1.13 dev allows for multiple plugin*.ini files. How does this work.
Well if you have a plugins.d folder in your PgAdmin III version folder, it will read all the inis in that folder and load them as plugins.&lt;/p&gt;

&lt;p&gt;Recall in &lt;a href=&quot;http://www.postgresonline.com/journal/archives/145-PgAdmin-III-Plug-in-Registration-PostGIS-Shapefile-and-DBF-Loader.html&quot; target=&quot;_blank&quot;&gt;PgAdmin III Plug-in Registration: PostGIS Shapefile and DBF Loader&lt;/a&gt;,
we demonstrated how to load the PostGIS shapefile and dbf loader as a plugin in PgAdmin III, well this time we will demonstrate how to do it using PgAdmin version 1.13. Better yet, we&#039;ll show you the new and improved
PgAdmin III Shapefile and DBF Loader in the works for PostGIS 2.0.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/180-PgAdmin-III-1.13-change-in-plugin-architecture-and-PostGIS-Plugins.html#extended&quot;&gt;Continue reading &quot;PgAdmin III 1.13 - change in plugin architecture and PostGIS Plugins&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 11 Oct 2010 03:16:31 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/180-guid.html</guid>
    <category>pgadmin</category>
<category>postgis</category>

</item>
<item>
    <title>Universal Unique Identifiers PostgreSQL SQL Server Compare</title>
    <link>http://www.postgresonline.com/journal/archives/179-Universal-Unique-Identifiers-PostgreSQL-SQL-Server-Compare.html</link>
            <category>8.2</category>
            <category>8.3</category>
            <category>8.4</category>
            <category>9.0</category>
            <category>beginner</category>
            <category>contrib spotlight</category>
            <category>ms access</category>
            <category>postgresql versions</category>
            <category>sql server</category>
            <category>uuid_osp</category>
    
    <comments>http://www.postgresonline.com/journal/archives/179-Universal-Unique-Identifiers-PostgreSQL-SQL-Server-Compare.html#comments</comments>
    <wfw:comment>http://www.postgresonline.com/journal/wfwcomment.php?cid=179</wfw:comment>

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

    <author>nospam@example.com (Leo Hsu and Regina Obe)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Universally_Unique_Identifier&quot; target=&quot;_blank&quot;&gt;Universal Unique Identifiers&lt;/a&gt; are 16-byte / 32-hexadecimal digit (with 4 -s for separation) 
identifiers standardized by the &lt;a href=&quot;http://en.wikipedia.org/wiki/Open_Software_Foundation&quot; target=&quot;_blank&quot;&gt;Open Software Foundation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt; 
The main use as far as databases go is to ensure uniqueness of keys across databases. This is important if you have multiple servers or disperate systems that need to replicate or share
data and each can generate data on its own end. You want some non-centralized mechanism to ensure the ids generated from each server will never overlap.  
There are various open standards
for generating these ids and each standard will tie the id based on some unique identifier of the computer or a namespace or just a purely random generator algorithm not tied to anything.
Since this is a question often asked by users coming from Microsoft SQL Server, we will demonstrate in this article the same concept in Microsoft SQL Server and how you would achieve similar functionality in PostgreSQL.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://www.postgresonline.com/journal/archives/179-Universal-Unique-Identifiers-PostgreSQL-SQL-Server-Compare.html#extended&quot;&gt;Continue reading &quot;Universal Unique Identifiers PostgreSQL SQL Server Compare&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 07 Oct 2010 18:55:00 -0400</pubDate>
    <guid isPermaLink="false">http://www.postgresonline.com/journal/archives/179-guid.html</guid>
    <category>global unique identifier</category>
<category>guid</category>
<category>universal unique identifier</category>
<category>uuid</category>

</item>

</channel>
</rss>
