如何为ActiveRecord编写数据库适配器

时间:2015-07-01 01:25:45

标签: ruby-on-rails postgresql activerecord

我是Rails的新手,我必须连接到自定义的postgresql,它有一些系统表已更改。使用默认的postgres适配器时,会抛出以下错误:

PG::UndefinedTable: ERROR:  relation "pg_type" does not exist
LINE 2:               FROM pg_type as t
                           ^
:               SELECT t.oid, t.typname, t.typelem, t.typdelim,t.typinput, r.rngsubtype, t.typtype, t.typbasetype
          FROM pg_type as t
          LEFT JOIN pg_range as r ON oid = rngtypid

ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "pg_type" does not exist
LINE 2:               FROM pg_type as t
                           ^
:               SELECT t.oid, t.typname, t.typelem, t.typdelim,t.typinput, r.rngsubtype, t.typtype, t.typbasetype
                FROM pg_type as t
          LEFT JOIN pg_range as r ON oid = rngtypid

这些sys-table以' pg _'开头。已经改变 !

所以我必须为令人毛骨悚然的数据库创建一个新的适配器。 是否有任何教程或指南可以遵循?

0 个答案:

没有答案
相关问题