title: heroku node.js error
body: <p><a href="https://github.com/hopyhopy1/C-Bot/blob/master/bot.js" rel="nofollow noreferrer">code</a> So, I decided to make a discord points bot using heroku and node.js but I keep getting this error:</p>
  
  <blockquote>
    <p>error: syntax error at or near "DUPLICATE"</p>
  </blockquote>
  
  <p>I tried debugging but got no results so yeah... i need help.
  what im sending to the sql postgresql database with javascript stuff:</p>
  
  <pre><code>'INSERT INTO points (Roblox_name, Points) VALUES (' + name + ', ' + amount + ') ON DUPLICATE KEY UPDATE Points=VALUES(' + amount + ')'
  </code></pre>
  
  <p>example{
  amount = 322
  and
  name = george
  }</p>
  
  <p>EDIT:
  raw application log [with VALUES(' + amount + ')' changed to ' + amount]:</p>
  
  <pre><code>2018-07-26T19:32:08.576609+00:00 app[worker.1]: Ready to serve on 1 servers, 
  for 6 users.
  2018-07-26T19:32:42.536398+00:00 app[worker.1]: /app/bot.js:56
  2018-07-26T19:32:42.536422+00:00 app[worker.1]:             if (err) throw 
  err;
  2018-07-26T19:32:42.536424+00:00 app[worker.1]:                      ^
  2018-07-26T19:32:42.536425+00:00 app[worker.1]: 
  2018-07-26T19:32:42.536427+00:00 app[worker.1]: error: syntax error at or 
  near "DUPLICATE"
  2018-07-26T19:32:42.536429+00:00 app[worker.1]:     at Connection.parseE 
  (/app/node_modules/pg/lib/connection.js:553:11)
  2018-07-26T19:32:42.536431+00:00 app[worker.1]:     at 
  Connection.parseMessage (/app/node_modules/pg/lib/connection.js:378:19)
  2018-07-26T19:32:42.536432+00:00 app[worker.1]:     at TLSSocket.&lt;anonymous&gt; 
  (/app/node_modules/pg/lib/connection.js:119:22)
  2018-07-26T19:32:42.536434+00:00 app[worker.1]:     at emitOne 
  (events.js:116:13)
  2018-07-26T19:32:42.536435+00:00 app[worker.1]:     at TLSSocket.emit 
  (events.js:211:7)
  2018-07-26T19:32:42.536437+00:00 app[worker.1]:     at addChunk 
  (_stream_readable.js:263:12)
  2018-07-26T19:32:42.536439+00:00 app[worker.1]:     at readableAddChunk 
  (_stream_readable.js:250:11)
  2018-07-26T19:32:42.536440+00:00 app[worker.1]:     at 
  TLSSocket.Readable.push (_stream_readable.js:208:10)
  2018-07-26T19:32:42.536442+00:00 app[worker.1]:     at TLSWrap.onread 
  (net.js:597:20)
  2018-07-26T19:32:42.629819+00:00 heroku[worker.1]: Process exited with 
  status 1
  2018-07-26T19:32:42.738809+00:00 heroku[worker.1]: State changed from up to 
  crashed
  </code></pre>
  
  <p>EDIT new error log:</p>
  
  <pre><code>2018-07-27T12:24:05.106369+00:00 app[worker.1]: { error: syntax error at or 
  near 
  "DUPLICATE"
  2018-07-27T12:24:05.106409+00:00 app[worker.1]:     at Connection.parseE 
  (/app/node_modules/pg/lib/connection.js:553:11)
  2018-07-27T12:24:05.106411+00:00 app[worker.1]:     at 
  Connection.parseMessage 
  (/app/node_modules/pg/lib/connection.js:378:19)
  2018-07-27T12:24:05.106412+00:00 app[worker.1]:     at TLSSocket.&lt;anonymous&gt; 
  (/app/node_modules/pg/lib/connection.js:119:22)
  2018-07-27T12:24:05.106413+00:00 app[worker.1]:     at emitOne 
  (events.js:116:13)
  2018-07-27T12:24:05.106414+00:00 app[worker.1]:     at TLSSocket.emit 
  (events.js:211:7)
  2018-07-27T12:24:05.106415+00:00 app[worker.1]:     at addChunk 
  (_stream_readable.js:263:12)
  2018-07-27T12:24:05.106417+00:00 app[worker.1]:     at readableAddChunk 
  (_stream_readable.js:250:11)
  2018-07-27T12:24:05.106418+00:00 app[worker.1]:     at 
  TLSSocket.Readable.push 
  (_stream_readable.js:208:10)
  2018-07-27T12:24:05.106419+00:00 app[worker.1]:     at TLSWrap.onread 
  (net.js:597:20)
  2018-07-27T12:24:05.106420+00:00 app[worker.1]:   name: 'error',
  2018-07-27T12:24:05.106422+00:00 app[worker.1]:   length: 98,
  2018-07-27T12:24:05.106423+00:00 app[worker.1]:   severity: 'ERROR',
  2018-07-27T12:24:05.106424+00:00 app[worker.1]:   code: '42601',
  2018-07-27T12:24:05.106425+00:00 app[worker.1]:   detail: undefined,
  2018-07-27T12:24:05.106426+00:00 app[worker.1]:   hint: undefined,
  2018-07-27T12:24:05.106427+00:00 app[worker.1]:   position: '72',
  2018-07-27T12:24:05.106428+00:00 app[worker.1]:   internalPosition: 
  undefined,
  2018-07-27T12:24:05.106429+00:00 app[worker.1]:   internalQuery: undefined,
  2018-07-27T12:24:05.106430+00:00 app[worker.1]:   where: undefined,
  2018-07-27T12:24:05.106431+00:00 app[worker.1]:   schema: undefined,
  2018-07-27T12:24:05.106433+00:00 app[worker.1]:   table: undefined,
  2018-07-27T12:24:05.106434+00:00 app[worker.1]:   column: undefined,
  2018-07-27T12:24:05.106435+00:00 app[worker.1]:   dataType: undefined,
  2018-07-27T12:24:05.106436+00:00 app[worker.1]:   constraint: undefined,
  2018-07-27T12:24:05.106437+00:00 app[worker.1]:   file: 'scan.l',
  2018-07-27T12:24:05.106438+00:00 app[worker.1]:   line: '1087',
  2018-07-27T12:24:05.106439+00:00 app[worker.1]:   routine: 'scanner_yyerror' 
  }
  </code></pre>