Skip to content

Commit 5d4cbcd

Browse files
author
Miguel Fernández
authored
Support populating foreign tables in Postgres (#42)
Foreign data wrappers allow for querying schemas defined in external systems from within Postgres. This commit adds support for populating foreign tables in Postgres, motivated by the need for populating a clickhouse schema accessed through a particular foreign data wrapper
1 parent 0c99b58 commit 5d4cbcd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sql.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ WHERE c.relkind IN ( 'r', '' )
112112
AND n.nspname !~ '^gp_toolkit'
113113
AND c.relkind = 'r'
114114
%s
115+
UNION
116+
SELECT foreign_table_schema as SCHEMA,
117+
foreign_table_name as table
118+
FROM information_schema.foreign_tables
115119
ORDER BY 1
116120
`
117121
// add where clause

0 commit comments

Comments
 (0)