diff options
author | Yannick Schutz <yannick.schutz@gmail.com> | 2018-07-27 03:09:00 +0200 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-07-27 10:09:00 +0900 |
commit | 36f28fd8184a999f82bd8b0388e31798bd856ae0 (patch) | |
tree | ca844634a01fa7be91aa0f974c080be19858a076 /activerecord/lib | |
parent | b4d91bb41f9cc555d80d0cb6b0a41179d26fa252 (diff) | |
download | rails-36f28fd8184a999f82bd8b0388e31798bd856ae0.tar.gz rails-36f28fd8184a999f82bd8b0388e31798bd856ae0.tar.bz2 rails-36f28fd8184a999f82bd8b0388e31798bd856ae0.zip |
PostgreSQL 10 new relkind for partitioned tables (#31336)
* PostgreSQL 10 new relkind for partitioned tables
Starting with PostgreSQL 10, we can now have partitioned tables natively
* Add comment
* Remove extra space
* Add test for partition table in postgreSQL10
* Select 'p' for "BASE TABLE" and add a test case
to support PostgreSQL 10 partition tables
* Address RuboCop offense
* Addressed incorrect `postgresql_version`
Fixes #33008.
[Yannick Schutz & Yasuo Honda & Ryuta Kamizono]
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index e20e5f2914..26b8113b0d 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -751,7 +751,7 @@ module ActiveRecord def data_source_sql(name = nil, type: nil) scope = quoted_scope(name, type: type) - scope[:type] ||= "'r','v','m','f'" # (r)elation/table, (v)iew, (m)aterialized view, (f)oreign table + scope[:type] ||= "'r','v','m','p','f'" # (r)elation/table, (v)iew, (m)aterialized view, (p)artitioned table, (f)oreign table sql = "SELECT c.relname FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace".dup sql << " WHERE n.nspname = #{scope[:schema]}" @@ -765,7 +765,7 @@ module ActiveRecord type = \ case type when "BASE TABLE" - "'r'" + "'r','p'" when "VIEW" "'v','m'" when "FOREIGN TABLE" |