# Postgresql Fixture Load Error After Rails 2.0 Upgrade

**URL:** <https://www.ruby-forum.com/t/postgresql-fixture-load-error-after-rails-2-0-upgrade/127459>\
**Category:** Rails\
**Created:** [January 29, 2008, 1:52pm UTC](https://www.ruby-forum.com/t/postgresql-fixture-load-error-after-rails-2-0-upgrade/127459 "2008-01-29T13:52:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![radwan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/cdc98d/32.png) [@radwan](https://www.ruby-forum.com/u/radwan)\
**Post date:** [January 29, 2008, 1:52pm UTC](https://www.ruby-forum.com/t/postgresql-fixture-load-error-after-rails-2-0-upgrade/127459/1 "2008-01-29T13:52:28Z")

</div>

Hello,

I just updated a small project I’m working on to RoR 2.0.2 from 1.2.4.  
I rely on a postgresql 8.0 database for storage and before the upgrade  
migrations and fixtures loading worked flawlessly. After the upgrade  
though, migrations work fine but fixtures just won’t load on my dev  
environment giving me the following error (invoked with --trace):

\*\* Invoke db:fixtures:load (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:fixtures:load  
rake aborted!  
RuntimeError: ERROR C42601 Msyntax error at or near “ENABLE” P25  
Fscan.l L639 Ryyerror: ALTER TABLE schema\_info ENABLE TRIGGER  
ALL;ALTER TABLE users ENABLE TRIGGER ALL;ALTER TABLE categories ENABLE  
TRIGGER ALL;ALTER TABLE entries ENABLE TRIGGER ALL  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/  
connection\_adapters/abstract\_adapter.rb:150:in `log' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/postgresql_adapter.rb:407:in`execute’  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/  
connection\_adapters/postgresql\_adapter.rb:376:in  
`disable_referential_integrity' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ fixtures.rb:505:in`create\_fixtures’  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/  
base.rb:1198:in `silence' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ fixtures.rb:504:in`create\_fixtures’  
/usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/tasks/databases.rake:  
157  
/usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/tasks/databases.rake:  
156:in `each' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/tasks/databases.rake: 156 /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in`call’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in  
`execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in`each’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in  
`execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in`invoke\_with\_call\_chain’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in  
`synchronize' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in`invoke\_with\_call\_chain’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in  
`invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in`invoke\_task’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in  
`top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in`each’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in  
`top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in`standard\_exception\_handling’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in  
`top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in  
`standard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in`run’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31  
/usr/local/bin/rake:19:in `load’  
/usr/local/bin/rake:19

I tried switching temporarily to a mysql database and the migrations  
and fixtures work well. Any ideas where the source of the problem  
could be?

---

<div class="post-metadata">

**Author:** ![radwan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/cdc98d/32.png) [@radwan](https://www.ruby-forum.com/u/radwan)\
**Post date:** [January 31, 2008, 9:45pm UTC](https://www.ruby-forum.com/t/postgresql-fixture-load-error-after-rails-2-0-upgrade/127459/2 "2008-01-31T21:45:30Z")

</div>

You need PostgreSQL 8.1 or later to run this.

The SQL above also requires you to run the tests under a database  
superuser. If it is not required, you are not using any foreign keys in  
the database.
