Rails - 2.3.8 数据库 - Postgres(9.2)
活动记录查询无法在双引号中生成表名,即
# this ran fine
Table.find_by_sql('Select * from "Table" Limit 1')
Sql generated - Select * from "Table" Limit 1
但问题来了,
Table.find(:first)
Sql generated - Select * from Table Limit 1 (Clearly noticed that table not in double quotes)
活动记录显示错误
ActiveRecord::StatementInvalid: RuntimeError: ERROR
C42P01 Mrelation "Table" does not exist
P15 Fparse_relation.c L864
RparserOpenTable: SELECT * FROM Table LIMIT 1
我觉得 postgresql 适配器无法在双引号中生成表名。