title: Split multiple points in text format and switch coordinates in postgres column
body: <p>I have a PostgreSQL column of type text that contains data like shown below</p>
  
  <pre><code>(32.85563, -117.25624)(32.855470000000004, -117.25648000000001)(32.85567, -117.25710000000001)(32.85544, -117.2556)
  (37.75363, -121.44142000000001)(37.75292, -121.4414)
  </code></pre>
  
  <p>I want to convert this into another column of type text like shown below</p>
  
  <pre><code>(-117.25624, 32.85563)(-117.25648000000001,32.855470000000004 )(-117.25710000000001,32.85567 )(-117.2556,32.85544 )
  (-121.44142000000001,37.75363 )(-121.4414,37.75292 )
  </code></pre>
  
  <p>As you can see, the values inside the parentheses have switched around. Also note that I have shown two records here to indicate that not all fields have same number of parenthesized figures. </p>
  
  <p><strong>What I've tried</strong>
  I tried extracting the column to Java and performing my operations there. But due to sheer amount of records I have, I will run out of memory. I also cannot do this method in batched due to time constraints.</p>
  
  <p><strong>What I want</strong>
  A SQL query or a sequence of SQL queries that will achieve the result that I have mentioned above. </p>
  
  <p>I am using PostgreSQL9.4 with PGAdmin III as the client</p>