Removed unsuded column names and added extra check to set the
foreign table schema if it is not if the default schema.