-
Notifications
You must be signed in to change notification settings - Fork 618
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
Added no_returning option for Postgres to insert without RETURNING clause #276
Conversation
Hi Jordan! Thanks for the quick response! I think there is even more general case – Btw I used my branch in our production setup for importing data – works Best, On 17 May 2016 at 00:23, Jordan Owens notifications@github.com wrote:
|
After more thought I decided your explicit option is the better choice, so I give it a 👍 |
@jkowens any idea about failing AR 5 tests? Looks like latest AR RC has some issue with mysql, there is same error in other PR. |
@makaroni4 yeah it turns out the seamless_database_pool gem is not currently compatible with ActiveRecord 5.0.0.rc1. I sent up a PR to fix, so hopefully there will be an updated release in the near future. See bdurand/seamless_database_pool#25 cc: @zdennis |
@makaroni4, seamless_database_pool is happy now in master thanks to @jkowens. Would you mind rebasing? |
…ause Drop unnecessary empty line in method
@zdennis done, squashed commits into 1 🚀 |
Thank you @makaroni4 ! |
This is going out in the 0.14.0 release. |
Bummer, this breaks TravisCI, but I think that is a JDBCDriver error. I'm not going to hold up the release due to the error, will investigate later and will possibly skip if this is a known limitation with that driver. |
Motivation for this PR: enable import without
RETURNING
clause (right now for every INSERT statementRETURNING
clause is applied). This will allow to use Postgres rules for insertion, for example the rule to simply ignore all duplications inside INSERT statement.Right now if we have smth like this in DB (Postgres younger than 9.5)
and try to insert duplicate we'll have an error
ActiveRecord::StatementInvalid: PG::FeatureNotSupported: ERROR: cannot perform INSERT RETURNING on relation "events" HINT: You need an unconditional ON INSERT DO INSTEAD rule with a RETURNING clause.