这是一个邮政编码搜索,在使用 mysql 的开发中运行良好,但是当部署到 heroku 时它会爆炸。
ActiveRecord::StatementInvalid (PG::Error: ERROR: syntax error at end of input
LINE 9: <= 6.21371192)
^
: SELECT "zip_codes"."zip_code" FROM "zip_codes" WHERE ((latitude BETWEEN 37.68949912779737
AND 37.869158872202625)
AND (longitude BETWEEN -122.53280459311426
AND -122.30549540688574)
AND sqrt(pow(69.172 *
(latitude-37.779329),2) +
pow(54.67189446319151 *
(longitude--122.41915),2))
<= 6.21371192)