<p>According to <a href="http://www.postgresql.org/docs/9.4/static/indexes-partial.html">docs</a> <code>WHERE</code> can be normal condition, so to be totally proper it should be written as:</p>

<pre><code>my $index = $table-&gt;add_index(name =&gt; 'myindex', options =&gt; [{using =&gt; 'hash'}, {where =&gt; {'upper(foo)' =&gt; 'bar', bar =&gt; 'foo'}}], fields =&gt; ['bar', 'lower(foo)']);
</code></pre>

<p>But this would require code similar to <code>SQL::Abstract-&gt;where</code>.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/dbsrgits/sql-translator/commit/c5b8904a2ea32dd974067d4dc3f0254085f9fd8c#commitcomment-11848533">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AASeApahgOLXuv_Y-gvaMCP8jlM4G8hnks5oWxuygaJpZM4FLNhn.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/dbsrgits/sql-translator/commit/c5b8904a2ea32dd974067d4dc3f0254085f9fd8c#commitcomment-11848533"></link>
    <meta itemprop="name" content="View Commit"></meta>
  </div>
  <meta itemprop="description" content="View this Commit on GitHub"></meta>
</div>