This project is archived and is in readonly mode.
postgresql - all returned .find_by_sql attributes are string
-
Jason Yuen
- Title changed from [PATCH] postgresql - all returned .find_by_sql attributes are string to postgresql - all returned .find_by_sql attributes are string
-
Tony Pitale
It seems the only type that is changed into another format by AR for postgresql is the Money type.
See postgresql_adaptor.rb #select_raw, it may be of help fixing this.
-
Tarmo Tänav
Looks like the newest postgresql gem, "pg", does not support translate_results, but it does implement "pgresult_ftype" which returns the OID of a column in a PGresult and would give us accurate information on the types of columns as known by postgresql.
I'm not sure however if that could be misleading in certain cases. For example if AR expects a value for a string column, but we construct the query in a way that makes postgresql return an integer then it would be unclear if we should convert it to string or integer (the value is integer, but the column that it supposedly comes from is string).
-
josh
- State changed from new to stale