Permalink
Browse files

fix, adjust OID query without range support to include required fields.

This is a follow-up fix to f7a6b11 and
06082f6
  • Loading branch information...
1 parent 06082f6 commit 5d0a4e0cb6134b86fc2795047aacb335c978e02e @senny senny committed Apr 1, 2014
Showing with 4 additions and 3 deletions.
  1. +4 −3 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -588,7 +588,7 @@ def initialize_type_map(type_map)
SQL
else
result = execute(<<-SQL, 'SCHEMA')
- SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput
+ SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, t.typtype, t.typbasetype
FROM pg_type as t
SQL
end
@@ -630,10 +630,11 @@ def initialize_type_map(type_map)
# populate domain types
domains.each do |row|
- if base_type = type_map[row["typbasetype"].to_i]
+ base_type_oid = row["typbasetype"].to_i
+ if base_type = type_map[base_type_oid]
type_map[row['oid'].to_i] = base_type
else
- warn "unknown base type (OID: #{row["typbasetype"].to_i}) for domain #{row["typname"]}."
+ warn "unknown base type (OID: #{base_type_oid}) for domain #{row["typname"]}."
end
end
end

0 comments on commit 5d0a4e0

Please sign in to comment.