title: PostGis invalid geometry
body: <p>I am having issue with postgis geometry. </p>
  
  <p>Following is my query</p>
  
  <pre><code>SELECT ST_GeomFromText(trim(data))
  FROM (SELECT replace(concat(concat('''POINT',concat(trim(TRAILING ')' FROM concat('(',trim(LEADING '(' FROM ea.region::TEXT)::TEXT) ),')')),''''),',',' ') as data from "erpAssets" as ea where ea.id=326816 )as foo;
  </code></pre>
  
  <p>It is giving error which is as follows:
  SQL error:</p>
  
  <blockquote>
    <p>ERROR:  parse error - invalid geometry HINT:  "'P" &lt;-- parse error at
    position 2 within geometry In statement: SELECT
    ST_GeomFromText(trim(data)) FROM (SELECT
    replace(concat(concat('''POINT',concat(trim(TRAILING ')' FROM
    concat('(',trim(LEADING '(' FROM ea.region::TEXT)::TEXT)
    ),')')),''''),',',' ') as data from "erpAssets" as ea where
    ea.id=326816 )as foo;</p>
  </blockquote>
  
  <p>When i run simple inner select query it gives me point data when i copy this data and put it in st_GeomFromText() then it is running f9. but when i use above query then it is giving me parse error</p>