question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot proceed to insert object X relation since insert to table X affects zero rows

See original GitHub issue

image

I want to insert a new opsOrder, and vehicle in single mutation. It runs without error if vehicle does not exist. But when vehicle is exist, it cannot be done. The return error message: cannot proceed to insert object relation \"vehicle\" since insert to table \"vehicle\" affects zero rows

I also added on_conflict constraint.

What should I do in above situation. Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
FickleLifecommented, Jan 21, 2021

I have a unique constraint on a generated field (which stores the lower case version of the name of the record) - so that cannot be updated. My (ugly) workaround is to have a blank field that I write null to…

3reactions
tirumaraiselvancommented, Aug 26, 2020

@samuela The workaround is to use the same column(s) that determine the uniqueness constraint. This way no new row is added. Although, this may have the side effect of executing any update triggers on the underlying table.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to insert array relationship in Hasura / GraphQL ...
I am using the Apollo iOS client to connect to our Hasura/postgress docker environment. I am trying to create an object and fill...
Read more >
Postgres: Upsert mutation | Hasura GraphQL Docs
An upsert query will insert an object into the database in case there is no conflict with another row in the table. In...
Read more >
4. Inserting, Updating, Deleting - SQL Cookbook [Book]
The technique is to insert into a view that is defined as the UNION ALL of the tables. If the check constraints are...
Read more >
Error when you update a row of a table - SQL Server
This article provides a workaround for the problem that occurs when you try to update a table by using SQL Server Management Studio...
Read more >
13.3.6 LOCK TABLES and UNLOCK TABLES Statements
The error occurs for the first INSERT because there are two references to the same name for a locked table. The second INSERT...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found