title: Rails and PSQL arrays, the difference between {} and []?
body: <p>I recently converted a column in my rails psql database to a PSQL array.</p>
  
  <p>When trying to query against the column using psql's contains operator (&lt;@) I'm getting an error that says</p>
  
  <pre><code>PG::InvalidTextRepresentation: ERROR:  array value must start with "{" or dimension information
  </code></pre>
  
  <p>The column format looks something like this in the rails console:</p>
  
  <pre><code>["string1",
   "string2",
   "string3"]
  </code></pre>
  
  <p>During my migration the column was set up like this:</p>
  
  <pre><code>add_column :table, :column, :text, :array =&gt; true, null: false, :default =&gt; []
  </code></pre>
  
  <p>and I then copied the contents of a different column into it.</p>
  
  <p>So two questions:</p>
  
  <p>1) Is my migration set up correctly? I've seen some people default their arrays to {} what is the difference?</p>
  
  <p>2) Is the issue my data formatting and if so what can I do to fix it?</p>