<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>The BFC Computing Weblog: Solving 'function "lexize" already exists with same argument types' in PostgreSQL</title>
    <link>http://blog.bfccomputing.com/articles/2008/06/19/solving-function-lexize-already-exists-with-same-argument-types-in-postgresql</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>My God, It's Full of Source!</description>
    <item>
      <title>Solving 'function &amp;quot;lexize&amp;quot; already exists with same argument types' in PostgreSQL</title>
      <description>&lt;p&gt;If you run across:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function "lexize" already exists with same argument types
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;in PostgreSQL, when adding tsearch2 to a database, even when you&amp;#8217;ve created a fresh new database, you probably have a corrupt copy of tsearch2 in your template1 database, which is used to create your &amp;#8216;fresh&amp;#8217; database.&lt;/p&gt;

&lt;p&gt;To fix this, copy the uninstall&lt;em&gt;tsearch2.sql somewhere temporarily (on a Fedora-derived OS it&amp;#8217;s at: &lt;code&gt;/usr/share/pgsql/contrib/uninstall&lt;/em&gt;tsearch2.sql&lt;/code&gt;) and remove the BEGIN; and END; transaction statements from the file, then run it against your template1, ala:&lt;/p&gt;

&lt;p&gt;psql template1 &amp;lt; /tmp/uninstall&lt;em&gt;tsearch2&lt;/em&gt;notransaction.sql &lt;/p&gt;

&lt;p&gt;and it will go through and delete all of tsearch2.  Expect some failure messages if it&amp;#8217;s partially deleted already, this is normal.&lt;/p&gt;

&lt;p&gt;Now you can load tsearch2 into your new database without complaints.&lt;/p&gt;</description>
      <pubDate>Thu, 19 Jun 2008 16:22:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:1060d0d6-77c0-4e7d-9c35-88fa5ee4a591</guid>
      <author>Bill McGonigle</author>
      <link>http://blog.bfccomputing.com/articles/2008/06/19/solving-function-lexize-already-exists-with-same-argument-types-in-postgresql</link>
      <category>Development</category>
      <category>Open Source</category>
      <trackback:ping>http://blog.bfccomputing.com/articles/trackback/4764</trackback:ping>
    </item>
  </channel>
</rss>
