Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an upsert in storeOrUpdate #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brendanlong
Copy link
Contributor

This uses ON CONFLICT DO UPDATE instead of checking the error
and making a second query. This is faster (fewer round trips) and
also simpler (don't need to make sure the error is actually a
conflict -- the server does that for us).

Fixes #7

This uses `ON CONFLICT DO UPDATE` instead of checking the error
and making a second query. This is faster (fewer round trips) and
also simpler (don't need to make sure the error is actually a
conflict -- the server does that for us).

Fixes Battochon#7
@Battochon
Copy link
Owner

Hello,

ON CONFLICT isn't supported in all PostgreSQL versions. For those working on an older version, this will break their setup no? What do you think about it?

@brendanlong
Copy link
Contributor Author

Hm I guess it was added in 9.5, which is still pretty recent. Maybe I can write an old-style manual upsert. I'll think about this more..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants