Commit b1bc6648 authored by Michael Kozono's avatar Michael Kozono

Fix FDW for PostgreSQL 11

In PG 11, `table_type` changed from 'FOREIGN TABLE' to 'FOREIGN'.
This commit avoids that difference entirely.
parent 6abfc790
......@@ -37,10 +37,9 @@ module Gitlab
Gitlab::Geo.cache_value(:geo_fdw_count_tables) do
sql = <<~SQL
SELECT COUNT(*)
FROM information_schema.tables
WHERE table_schema = '#{FOREIGN_SCHEMA}'
AND table_type = 'FOREIGN TABLE'
AND table_name NOT LIKE 'pg_%'
FROM information_schema.foreign_tables
WHERE foreign_table_schema = '#{FOREIGN_SCHEMA}'
AND foreign_table_name NOT LIKE 'pg_%'
SQL
::Geo::TrackingBase.connection.execute(sql).first.fetch('count').to_i
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment