diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-09 03:25:39 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-08-09 03:25:39 +0000 |
commit | d568fb61373074e015083ad39e0dc8168e81733b (patch) | |
tree | 6ec552512558f180e0a84f14ee2045831bffec7e /activerecord/lib | |
parent | af7a6e57cd718a6ca2182bfb7ee441ad3c1158fb (diff) | |
download | rails-d568fb61373074e015083ad39e0dc8168e81733b.tar.gz rails-d568fb61373074e015083ad39e0dc8168e81733b.tar.bz2 rails-d568fb61373074e015083ad39e0dc8168e81733b.zip |
PostgreSQL: autodetected sequences work correctly with multiple schemas. Rely on the schema search_path instead of explicitly qualifying the sequence name with its schema. Closes #5280.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4737 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 94584a5ea4..d2a65fec3f 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -315,8 +315,9 @@ module ActiveRecord AND def.adsrc ~* 'nextval' end_sql end - # check for existence of . in sequence name as in public.foo_sequence. if it does not exist, join the current namespace - result.last['.'] ? [result.first, result.last] : [result.first, "#{result[1]}.#{result[2]}"] + # check for existence of . in sequence name as in public.foo_sequence. if it does not exist, return unqualified sequence + # We cannot qualify unqualified sequences, as rails doesn't qualify any table access, using the search path + [result.first, result.last] rescue nil end |