title: Postgres Insert where not exists multiple values
body: <p>I want to insert multiple values in a Postgres table (value, guest_name, guest_room_number, created, employee_id, guest_group_id, table_numbers, show) if multiple values (value, guestName, guestRoomNumber) do not already exist. How can I achieve that?</p>
  
  <p>Thanks for the help.</p>
  
  <p>My try:</p>
  
  <pre><code> await this.db.query(
   `INSERT INTO app_trace(value, guest_name, guest_room_number, created, employee_id, guest_group_id, table_numbers, show)
    SELECT $1, $2, $3, $4, $5, $6, $7, $8
    WHERE NOT EXISTS (SELECT value FROM app_trace WHERE value=$1 AND guest_name=$2 AND guest_room_number=$3)`,
   [value, guestName, guestRoomNumber, created, employeeId, guestGroupId, tableNumbers, show]);`
  </code></pre>
  
  <p>The try is still saving the data, even though the values do exist in the DB.</p>
  
  <p>Example Data in the DB:</p>
  
  <pre><code>INSERT INTO "public"."app_trace"("id","value","guest_name","guest_room_number","created","employee_id","guest_group_id","table_numbers","show")
  VALUES
  (88,E'test',E'Maierei',E'123',E'2019-08-05 15:15:45.984+00',1,65866,E'90',NULL);
  </code></pre>
  
  <p>This try still inserts the data, but I do not want that.</p>
  
  <pre><code> await this.db.query(
   `INSERT INTO app_trace(value, guest_name, guest_room_number, created, employee_id, guest_group_id, table_numbers, show)
    SELECT $1, $2, $3, $4, $5, $6, $7, $8
    WHERE NOT EXISTS (SELECT value FROM app_trace WHERE value=$1 AND guest_name=$2 AND guest_room_number=$3)`,
   ['test', 'Maierei', '123', '2019-08-06 15:15:45.984+00', 1, 123445, '23', true]);`
  </code></pre>
  
  <p>I want that the statement is not inserting the data, because the values (value, guestName, guestRoomNumber) already exist in the table.</p>