title: Query against a Postgres array column type
body: <p><code>TL;DR</code> I'm wondering what the pros and cons are (or if they are even equivalent) between <code>@&gt; {as_champion, whatever}</code> and using <code>IN ('as_champion', 'whatever')</code> is. Details below:</p>
  
  <p>I'm working with Rails and using Postgres' array column type, but having to use raw sql for my query as the Rails finder methods don't play nicely with it. I found a way that works, but wondering what the preferred method is:</p>
  
  <p>The <code>roles</code> column on the <code>Memberships</code> table is my array column. It was added via rails as so:</p>
  
  <pre><code>add_column :memberships, :roles, :text, array: true
  </code></pre>
  
  <p>When I examine the table, it shows the type as: <code>text[]</code> (not sure if that is truly how Postgres represents an array column or if that is Rails shenanigans.</p>
  
  <p>To query against it I do something like:</p>
  
  <pre><code>Membership.where("roles @&gt; ?", '{as_champion, whatever}')
  </code></pre>