title: How to add multiple values in one query to a PostgreSQL array?
body: <p>So if I have a Javascript array of strings, how do I append each element to a row in the Postgres text[] column? This is what I'm currently using, but it's not yielding the desired result (which is just making the text array in the column of {&quot;1&quot;,&quot;2&quot;,&quot;3&quot;}.</p>
  <pre><code>let addNumbers = 'UPDATE numTable SET column1 = array_append(columnName, ($1)) WHERE uid = ($2)'
  
  let x = [&quot;1&quot;,&quot;2&quot;,&quot;3&quot;]
  </code></pre>
  <p>I'm querying to the db with</p>
  <pre><code>query(addNumbers, [x, uid]);
  </code></pre>
  <p>I've tried using array_append but this results in the column getting a value of</p>
  <pre><code>{&quot;{\&quot;1\&quot;,\&quot;2\&quot;,\&quot;3\&quot;}&quot;}
  </code></pre>
  <p>I'd prefer not to iterate and append each one individually because this'll obviously increase the number of database calls--any help is much appreciated!</p>