Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
Cómo resolver en Knex.js El comando ON CONFLICT DO UPDATE no puede afectar la fila por segunda vez

Había creado una consulta en Knex.js para insertar registros en la base de datos

 upsert(input) { if (isEmpty(input)) return Promise.resolve(0); return this.tx(tableName) .insert(input.map(prepareInput)) .onConflict([columns.candidateId, columns.startAt]) .merge() .returning() .then(({ rowCount }) => rowCount); }

Pero estoy recibiendo este error

 ON CONFLICT DO UPDATE command cannot affect row a second time

Necesito insertar datos y fusionarlos con los existentes y no estoy seguro de cómo debo editar esta consulta para evitar el error.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!