Postgresql flatten column & show entire information
<p>I have a table as follows:</p>

<pre><code>conversation_thread |postid| postType | post_text
            AA11    |  1   | Question |'How many whiskers do cats have?'
            AA11    |  2   | Reply    |"I think on average six"
            AA11    |  3   | Reply    |"Cats definitely have more than 12 whiskers"
            BB11    |  4   | Question |"A cat’s tail is held high means?"
            BB11    |  5   | Reply    |"The cat is utterly frustrated"
            BB11    |  6   | Reply    |"An uber happy cat"
</code></pre>

<p>I need to group by conversation_thread and then flatten the rows. I am using postgresql, so the following query works:</p>

<pre><code>select conversation_thread, array_agg(postid),
array_agg(post_text) as text, array_agg(title) as title from myTable
group by conversation_thread;
</code></pre>

<p>It gives me output as:</p>

<pre><code>conversation_thread|postid |post_text
            AA11   |{1,2,3}|{"How many whiskers do cats have?","I think on (...)}
            BB11   |{4,5,6}|{"A cat’s tail is held high means?", "The cat is (...)}
</code></pre>

<p>I do not get the complete text in the post_text field.
How can I get the entire text and not (...)</p>