title: How can I create a polygon using fields in PostgreSQL?
body: <p>I have 8 real values in a table that I'd like to combine into a polygon. I haven't been able to figure out how to create a polygon using these values though. I keep trying variations of</p>
  
  <pre><code>SELECT polygon(lat1,lon1,lat2,lon2,lat3,lon3,lat4,lon4) FROM table;
  </code></pre>
  
  <p>but keep getting errors about the polygon function not existing or an invalid input syntax for type polygon. Has anyone done this before?</p>