Example: Import foreign schema v2

Access data from EDB Postgres Advanced Server and connect to psql. Once you're connected to psql, follow these steps:

-- load extension first time after install
CREATE EXTENSION mysql_fdw;

-- create server object
CREATE SERVER mysql_server
         FOREIGN DATA WRAPPER mysql_fdw
         OPTIONS (host '127.0.0.1', port '3306');

-- create user mapping
CREATE USER MAPPING FOR postgres
    SERVER mysql_server OPTIONS (username 'foo', password 'bar');

-- import foreign schema
IMPORT FOREIGN SCHEMA edb FROM SERVER mysql_server INTO public;

 SELECT * FROM color;
 cid | cname
-----+--------
   1 | Red
   2 | Green
   3 | Orange

SELECT * FROM fruit;
 fid | fname
-----+--------
   1 | Orange
   2 | Mango

See IMPORT FOREIGN SCHEMA for more information.