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.

Feature request: Parameter for "ON CONFLICT"

See original GitHub issue

Is it possible that the transfer from the temporary table into the target table can be (optionally) extended with na ON CONFLICT ... DO NOTHING;. e.g.

Database.objects.from_csv(path, on_conflict="nothing", on_conflict_keys=["key"])

➡️

INSERT INTO table
SELECT * FROM temp_table
ON CONFLICT (key)
DO NOTHING;

? This would be of great help. Right now I’m using your tool to insert data into a table, except when there are duplicates. To achieve this I’m creating a temporary table with the above SQL command. But this results in two temporary tables, which could be avoided with an option for ON CONFLICT.

Thanks Oliver

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stolpeocommented, Aug 17, 2018

Mh. You are right. Right now I don’t need that anymore anyway. But you might need to specify that setting ignore_conflicts, one should also set drop_indexes and drop_constraints to False, otherwise there are no conflicts that this setting might apply to.

0reactions
palewirecommented, Aug 16, 2018

I didn’t include that because I didn’t see it in the Django implementation. Did I miss it there? Why do you see this as critical?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle conflicting HTTP GET param - Stack Overflow
What should I do? Just go with the first value, thus silently ignoring other values (what SO does) or return an error stating...
Read more >
Is it possible to change the amount of conflict allowed ... - GitHub
we notice that there are usually quite a few features, although not 100% mutually exclusive, also rarely take nonzero values simultaneously.
Read more >
How To Use ON CONFLICT CLAUSE in PostgreSQL
In ON CONFLICT query parameter, we can put the column name or the constraint name or a WHERE clause. First, we need to...
Read more >
Can you modify Conflict Checker parameters? - ServiceNow
Hi We want to run the conflict checker based on Cis owned by a third party. We create a blackout window based on...
Read more >
View & resolve data conflicts (Merge) - SQL Server
For a list of valid startup parameters, run ConflictViewer.exe -?. In the Select Conflict Table dialog box, select a database, publication, and ...
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