Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
博士后不允许&燃气轮机=&引用;但是mysql呢,如何克服呢?_Mysql_Ruby On Rails_Postgresql_Heroku_Heroku Postgres - Fatal编程技术网

博士后不允许&燃气轮机=&引用;但是mysql呢,如何克服呢?

博士后不允许&燃气轮机=&引用;但是mysql呢,如何克服呢?,mysql,ruby-on-rails,postgresql,heroku,heroku-postgres,Mysql,Ruby On Rails,Postgresql,Heroku,Heroku Postgres,我的本地rails数据库是mysql,但我的服务器主机(heroku)是Postgres。 可能是一个相当常见的组合 我有一个高级搜索表单,在开发模式下本地工作,但在生产模式下不工作,它看起来可能是Postgres特有的东西,heroku日志显示我得到: LINE 1: ...,18,19,17,4,32,23,24,16,6,13) and (version_number >= 0.0 or ... 2014-06-23T01:47:54.198026+00:00 app[web

我的本地rails数据库是mysql,但我的服务器主机(heroku)是Postgres。
可能是一个相当常见的组合

我有一个高级搜索表单,在开发模式下本地工作,但在生产模式下不工作,它看起来可能是Postgres特有的东西,heroku日志显示我得到:

    LINE 1: ...,18,19,17,4,32,23,24,16,6,13) and (version_number >= 0.0 or ...
2014-06-23T01:47:54.198026+00:00 app[web.1]:                                                              ^
2014-06-23T01:47:54.198022+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::UndefinedFunction: ERROR:  operator does not exist: character varying >= numeric
2014-06-23T01:47:54.198028+00:00 app[web.1]: HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
在日志中

在postgres中是否还有其他方法可以做>=呢


在本地,我确实看到
schema.rb中的
datatype
string
,这可能就是问题所在。有没有一种方法可以将它转换为pg rails的整数?

PostgreSQL肯定有
=
操作符:

您的问题是,您似乎正在将字符串与数字进行比较

有没有一种方法可以将它转换为整数,用于pg的rails


可能吧-但我们看不到您的代码。你写SQL了吗?还是你依赖ActiveRecord?数据映射器?续集如果不了解您所做的操作,将无法帮助。

要比较版本字符串,请参阅