def test_create_foreign_table(self):
        if self.db.version < 90100:
            self.skipTest('Only available on PG 9.1')
        inmap = self.std_map()
        inmap.update({'foreign data wrapper fdw1': {'server fs1': {}}})
        inmap['schema public'].update({'foreign table ft1': {
            'columns': [{'c1': {'type': 'integer'}},
                        {'c2': {'type': 'text'}}], 'server': 'fs1',
            'owner': self.db.user,
            'privileges': [{self.db.user: ['all']}, {'PUBLIC': ['select']},
                           {'user1': ['insert', 'update']}]}})
        sql = self.to_sql(inmap, [CREATE_FDW, CREATE_FS], superuser=True)
        # sql[0] = CREATE TABLE
        # sql[1] = ALTER TABLE OWNER
        assert sql[2] == "GRANT ALL ON TABLE ft1 TO %s" % self.db.user
        assert sql[3] == "GRANT SELECT ON TABLE ft1 TO PUBLIC"
        assert sql[4] == "GRANT INSERT, UPDATE ON TABLE ft1 TO user1"
Create a foreign table with some privileges
dataset/ETHPy150Open perseas/Pyrseas/tests/dbobject/test_privs.py/PrivilegeToSqlTestCase.test_create_foreign_table