Support for FOREIGN TABLES

Simple patch to support FOREIGN TABLES