title: PostgreSQL array_agg order
body: <p>Table 'animals':</p>
  
  <pre><code>animal_name animal_type
  Tom         Cat
  Jerry       Mouse
  Kermit      Frog
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>SELECT 
  array_to_string(array_agg(animal_name),';') animal_names,
  array_to_string(array_agg(animal_type),';') animal_types
  FROM animals;
  </code></pre>
  
  <p>Expected result:</p>
  
  <pre><code>Tom;Jerry;Kerimt, Cat;Mouse;Frog
  OR
  Tom;Kerimt;Jerry, Cat;Frog;Mouse
  </code></pre>
  
  <p>Can I be sure that order in first aggregate function  will always be the same as in second.
  I mean I would't like to get:</p>
  
  <pre><code>Tom;Jerry;Kermit, Frog;Mouse,Cat
  </code></pre>