I have created this foreign SQL Server using tds_fdw foreign data wrapper:
CREATE SERVER servprod_sqlprod_mydb
FOREIGN DATA WRAPPER tds_fdw
OPTIONS (servername 'XX.XX.XX.XX', port '1501',msg_handler 'notice', database 'WHATEVER');
CREATE USER MAPPING FOR postgres
SERVER servprod_sqlprod_mydb
OPTIONS (username 'xxx', password 'xxxxxxxxxx');
CREATE FOREIGN TABLE tds_test (
caclamun character varying,
caclacal character varying,
catipvia character varying,
cadescri character varying,
caidenti character varying,
cafechal character varying,
cafechba character varying)
SERVER servprod_sqlprod_mydb
OPTIONS (table_name 'dbo.MYSQL TABLE');
When opening the table I am getting:
'utf-8' codec can't decode byte 0xd1 in position 4: invalid continuation byte
I think it is a postgresql issue and not tds_fdw's, but I am not sure.