Geo: Make FDW work with PostgreSQL 11
On my demo node on PostgreSQL 9.6:
Locally on PostgreSQL 11.1:
This is a problem for this query: https://gitlab.com/gitlab-org/gitlab-ee/blob/b9f8569/ee/lib/gitlab/geo/fdw.rb#L39:
SELECT COUNT(*)
FROM information_schema.tables
WHERE table_schema = '#{FOREIGN_SCHEMA}'
AND table_type = 'FOREIGN TABLE'
AND table_name NOT LIKE 'pg_%'
This might work for both PG versions:
SELECT COUNT(*)
FROM information_schema.foreign_tables
WHERE foreign_table_schema = '#{FOREIGN_SCHEMA}'
AND foreign_table_name NOT LIKE 'pg_%'