<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->add_index(name => 'myindex', options => [{using => 'hash'}, {where => {'upper(foo)' => 'bar', bar => 'foo'}}], fields => ['bar', 'lower(foo)']);
</code></pre>
<p>But this would require code similar to <code>SQL::Abstract->where</code>.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<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>