Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6390447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:32:58+00:00 2026-05-25T03:32:58+00:00

I’m under Rails 3.0.9, with Ruby 1.9.2 (p290). Using Postgresql 9.0.4, and the ‘pg’

  • 0

I’m under Rails 3.0.9, with Ruby 1.9.2 (p290).
Using Postgresql 9.0.4, and the ‘pg’ gem v0.11.0

The problem is :

I’ve got a really simple migration just changing the value of a column with conditions :

def self.up
  Closet.reset_column_information
  say_with_time "Unifying gender column to h/f" do
    Closet.connection.update "UPDATE closets AS c SET gender='h' WHERE c.gender IN ('homme', 'Homme', 'men', 'Men');"
    Closet.connection.update "UPDATE closets AS c SET gender='f' WHERE c.gender IN ('femme', 'Femme', 'women', 'Women');"
  end
end

Every request works perfectly in my erb console and in the pgAdmin SQL’s console too, but when I run the migration it says :

PGError: ERROR:  current transaction is aborted, commands ignored until end of transaction block

If anyone as an idea…

Here is bigger part of the error message stack :

== MigrateClosets: migrating =================================================
rake aborted!
An error has occurred, this and all later migrations canceled:

PGError: ERROR:  current transaction is aborted, commands ignored until end of transaction block
: UPDATE closets SET gender='h' WHERE closets.gender  = 'homme';
/Users/gdurelle/.rvm/gems/ruby-1.9.2-p290@dressmeNG/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:207:in `rescue in log'
/Users/gdurelle/.rvm/gems/ruby-1.9.2-p290@dressmeNG/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:199:in `log'
/Users/gdurelle/.rvm/gems/ruby-1.9.2-p290@dressmeNG/gems/activerecord-3.0.9/lib/active_record/connection_adapters/postgresql_adapter.rb:514:in `execute'
/Users/gdurelle/.rvm/gems/ruby-1.9.2-p290@dressmeNG/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:288:in `update_sql'
/Users/gdurelle/.rvm/gems/ruby-1.9.2-p290@dressmeNG/gems/activerecord-3.0.9/lib/active_record/connection_adapters/postgresql_adapter.rb:525:in `update_sql'
/Users/gdurelle/.rvm/gems/ruby-1.9.2-p290@dressmeNG/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:49:in `update'
/Users/gdurelle/.rvm/gems/ruby-1.9.2-p290@dressmeNG/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/query_cache.rb:16:in `update'
/Users/gdurelle/Sites/rails/DressMeNextGen/db/migrate/20110613125139_migrate_closets.rb:4:in `up'
/Users/gdurelle/.rvm/gems/ruby-1.9.2-p290@dressmeNG/gems/activerecord-3.0.9/lib/active_record/migration.rb:314:in `block in migrate'
/Users/gdurelle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/benchmark.rb:295:in `measure'
/Users/gdurelle/.rvm/gems/ruby-1.9.2-p290@dressmeNG/gems/activerecord-3.0.9/lib/active_record/migration.rb:314:in `migrate'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:32:59+00:00Added an answer on May 25, 2026 at 3:32 am

    Here are a couple wild guesses that might help. Looks like you have a transaction aborting, being caught, and ignored somewhere; that can mess up the entire transaction the self.up runs in and that would explain your error message and the behavior you’re seeing.

    The reset_column_information call usually goes after the database change and only if the schema has changed and you need to use the new schema for the rest of the migration; neither of these apply to you so you can drop Closet.reset_column_information completely.

    You should also have an execute method available in your migrations so there’s no need to talk to the Closet at all. Also, you don’t need semicolons at the end of your SQL statements; they probably won’t hurt but if we strip this right down to the bare essentials we might make the problem go away.

    Try this and see what happens:

    def self.up
      say_with_time "Unifying gender column to h/f" do
        execute %q{UPDATE closets SET gender = 'h' WHERE gender IN ('homme', 'Homme', 'men', 'Men')}
        execute %q{UPDATE closets SET gender = 'f' WHERE gender IN ('femme', 'Femme', 'women', 'Women')}
      end
    end
    

    This gives us the bare minimum that we need to get your database updated. Hopefully the stray transaction problem went away with all the other stuff you didn’t need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.