This project is archived and is in readonly mode.
Postgres: Invalid default value getting from character varying columns.
Reported by foot | May 20th, 2009 @ 08:00 PM | in 3.x
Migrating script:
create_table "order_users", :force => true do |t|
t.string "username", :limit => 50
t.string "email_address", :limit => 50, :default => "test1", :null => false
t.string "password", :limit => 20
t.datetime "created_on"
t.string "first_name", :limit => 50, :default => "test2", :null => false
t.string "last_name", :limit => 50, :default => "test3", :null => false
end</code>
Creating new object:
>> OrderUser.new
=> #<OrderUser id: nil, username: nil, email_address: "'test1'::character varying", password: nil, created_on: nil, first_name: "'test2'::character varying", last_name: "'test3'::character varying">
Rails 2.3.2
Postgresql 8.3.7
postgres gem (0.7.9.2008.01.28)
Comments and changes to this ticket
-
foot May 21st, 2009 @ 10:42 AM
This happens because postgres adapter use ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PostgreSQLColumn class (where it find it?) for columns definition instead ActiveRecord::ConnectionAdapters::PostgreSQLColumn class.
This modification helps for me.
-
Michael Koziarski August 3rd, 2009 @ 06:06 AM
- Assigned user set to Tarmo Tänav
-
edraut August 26th, 2009 @ 02:33 PM
This bug is caused by the acts_as_tsearch plugin. I'll include a patch here to show why, but it looks like there is no bug in active_record. I suggest closing this. I will submit the patch to the acts_as_tsearch maintainer.
-
foot August 26th, 2009 @ 05:08 PM
Thanks! This works for me. In my project the acts_as_tsearch plugin was installed.
-
sarah (at ultrasaurus) December 13th, 2009 @ 04:37 PM
patch applied (plus other improvements to acts_as_tsearch) at: http://github.com/wolframarnold/acts_as_tsearch
-
Rohit Arondekar October 9th, 2010 @ 04:13 AM
- State changed from new to resolved
- Importance changed from to
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>