Re: BUG #15287: postgres_fdw: the "WHERE date_trunc('day', dt) = 'YYYY-MM-DD' does not push to remote.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Ireneusz Pluta <ipluta(at)wp(dot)pl>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15287: postgres_fdw: the "WHERE date_trunc('day', dt) = 'YYYY-MM-DD' does not push to remote.
Date: 2018-07-21 05:44:26
Message-ID: 7332.1532151866@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jeff Janes <jeff(dot)janes(at)gmail(dot)com> writes:
> On Fri, Jul 20, 2018 at 2:28 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> However, that could only fix the OP's problem for these particular
>> functions, which are a small fraction of the ones we have that take
>> collatable types but don't really care about collation. I kinda feel
>> like we should have invented an "ignores collation" function property,
>> so that such functions could be identified --- that would not only let
>> postgres_fdw handle this honestly, but we could refrain from throwing
>> unmatched-collations errors for cases where it doesn't really matter.

> Would this automatically apply to operators as well, like hstore's ->
> operator, once the fetchval function was marked?

Sure, just like a function's volatility (for example) applies to operators
based on it. It'd require a bit of additional code to make that happen,
but I'd expect that to be included in any patch for this purpose.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-07-21 11:47:12 BUG #15289: Type inference of parameters in prepared statements can sometimes fail or succeed, depending...
Previous Message Thomas Munro 2018-07-21 01:39:12 Re: BUG #15285: Query used index over field with ICU collation in some cases wrongly return 0 rows