This project is archived and is in readonly mode.
ActiveRecord Beta 4 does not understand most postgres data types
-
Steve Madsen
This ticket sounds very similar to #4270 Arel 0.3.2 broke non-standard column types.
Rails 3.0 RC is unable to save models that make use of Postgres custom data types. Reading is fine; columns with a custom type are treated as String, but writing, even when the custom type column is unchanged, raises the exception reported here.
I made a small change to
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, around line 119, essentially never delegating type simplification to the superclass. If a specific mapping can't be determined, I always use:string. This fixes my immediate problem, where I don't care about working with the custom type column. (In my case, the custom type is optimized for PostgreSQL indexing and is maintained by a trigger.)Fixing the ARel issue with the error message looks simple. Instead of complaining about
column.type, it should report thecolumn.sql_type.I'm happy to work up patches for both of these one-liners, but given the stagnation on #4270 Arel 0.3.2 broke non-standard column types, I'd like some direction before taking the time to do so.
-
Andrea Campi
Can you verify whether this is still an issue after the fix for #5477 Arel won't let ActiveRecord query against tables that have columns it doesn't... has been committed?
-
Santiago Pastorino
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale