>>>>> "H" == Hoss Firooznia <hoss / lodestone.org> writes:

H> So why doesn't it work?  Am I doing something wrong?  Also, in case it's
H> relevant, I'm using ruby version 1.6.4 (2001-06-19).

 Well, there are 2 ways to see this case

  * the first is to consider that ::new just create some struct (only
    memory allocation) and that #initialize take extra arguments to
    initialize (:-)) some members.

  * the second is to consider that ::new not only make memory allocation but
    also perform an initial setup, #initialize in this case is used to do
    an extra setup.

 For postgres, this is the second choice and the initial setup is the
 connection to the database. This mean that in your case you must not
 redefine #initialize, but redefine ::new.

 Just write it

  require 'postgres'

  class MyPGconn < PGconn
      def self.new
          begin
              super(nil, nil, nil, nil, 'dbname', 'user', 'pass')
          end
      end
  end


Guy Decoux