是'字段'和'类型'允许rails postgresql表的名字?

时间:2015-01-27 04:09:58

标签: ruby-on-rails postgresql

我想在postgresql中将我的表命名为'fields'和'types',用于rails 4(ActiveRecord)应用程序 - 这些常用词可以作为名称使用,还是会与rails或postgresql冲突保留名字?

1 个答案:

答案 0 :(得分:2)

这可能与以下内容重复:Reserved names with ActiveRecord models

以下是有关postgres中保留字的其他信息:http://www.postgresql.org/docs/8.1/static/sql-keywords-appendix.html

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