From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Rhys A(dot)D(dot) Stewart" <rhys(dot)stewart(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: postgres_fdw pushdown problem. |
Date: | 2018-11-20 18:23:47 |
Message-ID: | 26365.1542738227@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
"Rhys A.D. Stewart" <rhys(dot)stewart(at)gmail(dot)com> writes:
> I'm using postgres_fdw and am having a pushdown issue. The TL;DR is
> that the where clause doesn't get pushed down for the last of the
> following three queries.
> SELECT * FROM service.mrrdr_synth WHERE premises = '1057430';
> SELECT * FROM service.mrrdr_synth WHERE reading_val = '8';
> SELECT * FROM service.mrrdr_synth WHERE location_capture_time =
> '2018-10-20 12:02:53.097247-05'::timestamptz;
Well, you've got
> CREATE FOREIGN TABLE service.mrrdr_synth( ...
> location_capture_time timestamp without time zone NULL,
so that WHERE clause is a comparison of timestamp vs timestamptz,
which depends on the active timezone setting, so it's not immutable
and won't get pushed. (In English: the planner is afraid the remote
end might be using a different timezone setting.) I'm pretty sure
either timestamp = timestamp or timestamptz = timestamptz would be
pushable.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Rhys A.D. Stewart | 2018-11-20 18:40:31 | Re: postgres_fdw pushdown problem. |
Previous Message | Rhys A.D. Stewart | 2018-11-20 18:03:32 | postgres_fdw pushdown problem. |