This project is archived and is in readonly mode.
postgresql_adapter doesn't disable referential integrity for pg 9.0
Reported by noelp | September 15th, 2010 @ 10:26 PM
When running tests, referential integrity is not disabled for PG 9.0. The method supports_disbale_referential_integrity? in the active_record/connection_adapters/postgresql_adapter.rb checks for versions greater than 8 AND with a minor version greater than 1. So, it does not correctly handle PG 9.0.
I have a patch that uses the scaler postgresql_version that is widely used in the module. The patch also fixes the module's parsing of version revisions when a release number is missing (9.0 vs 9.0.1).
Comments and changes to this ticket
-
noelp September 15th, 2010 @ 10:56 PM
- Tag changed from active_record, postgres, postgresql to active_record, patch, postgres, postgresql
-
MatthewRudy November 20th, 2010 @ 04:23 PM
+1 on this I ended up coding the same thing.
You got there first
:) -
MatthewRudy November 21st, 2010 @ 12:51 PM
By the way, though.
Why did you just comment the old code?Here is my patch.
kind of the same,
but I bit cleaner (I feel) -
MatthewRudy November 21st, 2010 @ 12:55 PM
By the way, though.
Why did you just comment the old code?Here is my patch.
kind of the same,
but I grab the string a bit more cleanly (I feel)if query('SELECT version()')[0][0] =~ /PostgreSQL ([0-9.]+)/ major, minor, tiny = $1.split(".") (major.to_i * 10000) + (minor.to_i * 100) + tiny.to_i else 0 end
my branch on github. https://github.com/matthewrudy/rude-rails/tree/disable-keys-for-pos... -
MatthewRudy November 22nd, 2010 @ 03:37 AM
In order to get by for the moment,
I have added this as an initializer.Check out my gist.
https://gist.github.com/709480 -
noelp November 22nd, 2010 @ 04:10 PM
Matthew's Patch is cleaner. I have no idea why I left the old code commented out.
-
Santiago Pastorino December 11th, 2010 @ 06:53 PM
- State changed from new to resolved
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>