tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
371 stars 101 forks source link

where condition ignoring #164

Open 4321ip opened 6 years ago

4321ip commented 6 years ago

DROP FOREIGN TABLE IF EXISTS fdw_server.xxx; CREATE FOREIGN TABLE fdw_server.xxx (col text) SERVER server OPTIONS (query ' select 111 as col '); select * from fdw_server.xxx where col = 'qwerty';

result:


col 111


this is a bug?

SudoerWithAnOpinion commented 6 years ago

Clearly this is a bug, I've seen it on a few occasions and if I remember correctly, casting to TEXT resolves it. Try:

select * from fdw_server.xxx where col::TEXT = 'qwerty';