title: Insert POINT into postgres database
body: <p>I need to insert/update a point column type in postgres database.</p>
  
  <p>I'm using <code>node-postgres</code> </p>
  
  <p>The script generated using POSTGRES admin panel shows the update query as </p>
  
  <p><code>UPDATE public.places SET id=?, user_id=?, business_name=?, alternate_name=?, primary_category=?, categories=?, description=?, address=?, city=?, state=?, country=?, zip=?, point WHERE &lt;condition&gt;;</code></p>
  
  <p>How do I achieve point from latitude and longitude? </p>
  
  <p>I have seen couple of answers using POSTGIS, but could not get it working.</p>
  
  <p>In the documentation of POSTGRES (<a href="https://www.postgresql.org/docs/9.2/static/xfunc-sql.html" rel="noreferrer">https://www.postgresql.org/docs/9.2/static/xfunc-sql.html</a>) it is mentioned we can use <code>point '(2,1)'</code>, but this does not work with pg query.</p>
  
  <p>What I have now : </p>
  
  <pre><code>var config = {
    user: 'postgres',
    database: 'PGDATABASE',
    password: 'PGPASSWORD!',
    host: 'localhost',
    port: 5432,
    max: 10,
    idleTimeoutMillis: 30000
  };
  </code></pre>
  
  <p>And the update part : </p>
  
  <pre><code>app.post('/updatePlaces', function(req, res, next) {
      console.log("Update");
      console.log(req.body.places);
      pool.query('UPDATE places SET address = $1, alternate_name = $2, business_name = $3, categories = $4, city = $5, country = $6, description = $7, point = $8, primary_category = $9, state = $10, zip = $11', [req.body.places.address, req.body.places.alternate_name, req.body.places.business_name, req.body.places.categories, req.body.places.city, req.body.places.country, req.body.places.description, (req.body.places.point.x, req.body.places.point.y), req.body.places.primary_category, req.body.places.state, req.body.places.zip], function(err, result) {
        if(err) {
            console.log(err);
            return err;
        }
  
        res.send(result.rows[0]);
      });
  });
  </code></pre>
  
  <p>Tried many different ways for passing point : </p>
  
  <ol>
  <li>(req.body.places.point.x, req.body.places.point.y)</li>
  <li>point(req.body.places.point.x, req.body.places.point.y)</li>
  <li>point '(2,1)'</li>
  </ol>
  
  <p>All the above throws error. Do I need to use POSTGIS?</p>