postgres_fdw - IS TRUE/FALSE conditions are not pushed down

Поиск
Список
Период
Сортировка
От Sergiy Zuban
Тема postgres_fdw - IS TRUE/FALSE conditions are not pushed down
Дата
Msg-id CAGz8fGabvwUehJ8ssiFRFPmT80ymXToChhTzHbWpmfXq86DmNQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: postgres_fdw - IS TRUE/FALSE conditions are not pushed down
Список 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 по дате отправления:

Предыдущее
От: Anil Menon
Дата:
Сообщение: Referencing serial col's sequence for insert
Следующее
От: Sergiy Zuban
Дата:
Сообщение: postgres_fdw - push down conditionals for ENUMs