postgres_fdw - IS TRUE/FALSE conditions are not pushed down - Mailing list pgsql-general

From Sergiy Zuban
Subject postgres_fdw - IS TRUE/FALSE conditions are not pushed down
Date
Msg-id CAGz8fGabvwUehJ8ssiFRFPmT80ymXToChhTzHbWpmfXq86DmNQ@mail.gmail.com
Whole thread Raw
Responses Re: postgres_fdw - IS TRUE/FALSE conditions are not pushed down  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi 

I've setup foreign table and noticed inconsistency how conditionals handled for boolean columns. 

explain verbose select * from temporary_testing.t_proxied where active is true; 
                                      QUERY PLAN 
-------------------------------------------------------------------------------------- 
 Foreign Scan on temporary_testing.t_proxied  (cost=100.00..194.72 rows=1412 width=5) 
   Output: id, active 
   Filter: (t_proxied.active IS TRUE) 
   Remote SQL: SELECT id, active FROM main_testing.t_url 

But, when = used instead of IS it works correctly. All conditions below (including IS NULL) are pushed down to remote server: 

explain verbose select * from temporary_testing.t_proxied where active; 
explain verbose select * from temporary_testing.t_proxied where NOT(active); 
explain verbose select * from temporary_testing.t_proxied where active = false; 
explain verbose select * from temporary_testing.t_proxied where active = true; 

-------------------------------------------------------------------------------------- 
 Foreign Scan on temporary_testing.t_proxied  (cost=100.00..166.48 rows=1412 width=5) 
   Output: id, active 
   Remote SQL: SELECT id, active FROM main_testing.t_url WHERE (active) 


explain verbose select * from temporary_testing.t_proxied where active is null; 
                                     QUERY PLAN 
------------------------------------------------------------------------------------ 
 Foreign Scan on temporary_testing.t_proxied  (cost=100.00..138.52 rows=14 width=5) 
   Output: id, active 
   Remote SQL: SELECT id, active FROM main_testing.t_url WHERE ((active IS NULL)) 

DO I need to report this as bug? 

Tested on PostgreSQL 9.3.4 
--
Sergiy Zuban

pgsql-general by date:

Previous
From: Anil Menon
Date:
Subject: Referencing serial col's sequence for insert
Next
From: Sergiy Zuban
Date:
Subject: postgres_fdw - push down conditionals for ENUMs