aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-04-01 23:41:25 +0200
committerYves Senn <yves.senn@gmail.com>2014-04-01 23:41:25 +0200
commit5d0a4e0cb6134b86fc2795047aacb335c978e02e (patch)
tree9c066916dcb1ffceb1883ae1315291eb4a66032b /activerecord/lib/active_record/connection_adapters
parent06082f66d541e581110406bbac3bc395bace3f86 (diff)
downloadrails-5d0a4e0cb6134b86fc2795047aacb335c978e02e.tar.gz
rails-5d0a4e0cb6134b86fc2795047aacb335c978e02e.tar.bz2
rails-5d0a4e0cb6134b86fc2795047aacb335c978e02e.zip
fix, adjust OID query without range support to include required fields.
This is a follow-up fix to f7a6b115fea9f675190a79b701c7034214678f19 and 06082f66d541e581110406bbac3bc395bace3f86
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 0b29f4ca16..e17558bdeb 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -588,7 +588,7 @@ module ActiveRecord
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 @@ module ActiveRecord
# 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