ruby-on-rails - 'fields' 和 'types' 是否允许用于 rails postgresql 表的名称?

标签 ruby-on-rails postgresql

我想将我在 postgresql 中的表命名为“fields”和“types”,以便在 rails 4 (ActiveRecord) 应用程序中使用——这些常用词是否可以作为名称接受,或者它们是否会与 rails 或 postgresql 冲突保留名称?

最佳答案

这可能是以下内容的副本:Reserved names with ActiveRecord models

这是关于 postgres 中保留字的附加信息:http://www.postgresql.org/docs/8.1/static/sql-keywords-appendix.html

最终,答案是否定的,'fields' 不是 rails 或 postgres 的保留名称;但是,“类型”可能会导致一些问题。 Type 是一个 ActionView 方法,符合以下条件:http://api.rubyonrails.org/classes/ActionView/Template.html#method-i-type

关于ruby-on-rails - 'fields' 和 'types' 是否允许用于 rails postgresql 表的名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28163105/

相关文章:

postgresql - 一个简单的 PL/pgSQL 函数的错误

ruby-on-rails - 在 Ruby 中将哈希数组转换为一个哈希

ruby-on-rails - Rails 列出所有有效的内容类型

postgresql - 设置 Postgres : Can't connect remotely to Postgres server (debian)

postgresql - 如何在不使用 FULL OUTER JOIN 的情况下有条件地分组到列中

postgresql - pg_column_size 怎么可能小于 octet_length?

ruby-on-rails - 带有 ruby​​ on rails 的 twitter Bootstrap 模式

ruby-on-rails - 无法将 CollectionProxy 对象传递给 ActiveJob

ruby-on-rails - 在初始化程序中获取 rake 任务名称

postgresql - 警告 : concurrent delete in progress within table while creating index in big table in Postgres 9. 2