Rails2.3.2→2.3.3で「undefined method `quote_ident'」エラー


Postgresql with Rails2.3.2の環境を、2.3.3に上げてみたら以下のようなエラーが発生してrakeが通らない。

C:\hoge>rake test:units
(in C:\hoge)
Couldn't drop db_hoge : #<NoMethodError: undefined method `quote_ident' for PGconn:Class>


何事かと思いきや、以下の報告を発見。
http://groups.google.co.jp/group/rubyonrails-talk/browse_thread/thread/e1e178ded85a11cb

どうやらpostgres-prがRails2.3.3に追随していない事による問題らしい。
報告通りconfig/initializers/new_rails_defaults.rbを以下のようにして解決。※記述位置には留意する必要があり。

# Be sure to restart your server when you modify this file.

# ※ActiveRecordの初期化前に行う必要があるため、ファイルの先頭で初期化する。
#   初めはファイルの最後に記述を加えたがエラーが解決されなかった。
# for Rails2.3.3 with PostgreSQL
class PGconn
  def PGconn.quote_ident(name)
    %("#{name}")
  end
end

# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.

if defined?(ActiveRecord)
  # Include Active Record class name as root for JSON serialized output.
  ActiveRecord::Base.include_root_in_json = true