Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgZFQ-0002Ot-A5 for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Jul 2018 17:31:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fgZFO-0000KP-H9 for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Jul 2018 17:31:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgZFO-0000KD-BC for pgsql-bugs@lists.postgresql.org; Fri, 20 Jul 2018 17:31:18 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgZFL-00034d-N7 for pgsql-bugs@lists.postgresql.org; Fri, 20 Jul 2018 17:31:17 +0000 Received: from [192.168.127.1] (port=37948 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1fgZFK-0006pU-21; Fri, 20 Jul 2018 17:31:14 +0000 Received: from [127.0.0.1] (port=21218 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1fgZFJ-000LtP-DI; Fri, 20 Jul 2018 17:31:13 +0000 From: Andrew Gierth To: Tom Lane Cc: Ireneusz Pluta , Andres Freund , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15287: postgres_fdw: the "WHERE date_trunc('day', dt) = 'YYYY-MM-DD' does not push to remote. In-Reply-To: <23967.1532106431@sss.pgh.pa.us> (Tom Lane's message of "Fri, 20 Jul 2018 13:07:11 -0400") Message-ID: <87effxizux.fsf@news-spur.riddles.org.uk> References: <153210427860.1404.15984608571673921883@wrigleys.postgresql.org> <20180720163945.exro5xgl7skq3kzo@alap3.anarazel.de> <9d6b978a-1aff-4f9e-03c6-0489836570d8@wp.pl> <23967.1532106431@sss.pgh.pa.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Fri, 20 Jul 2018 18:31:13 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Tom" == Tom Lane writes: Tom> Alternatively, if postgres_fdw could know which functions don't Tom> really pay attention to their input collation, it could skip this Tom> check for those functions. But that's not an easy thing to fix Tom> either. Wild idea: we have quite a few functions (e.g. date_trunc, date_part, timezone, encode, decode, make_timestamptz, plus various extension functions such as in pgcrypto) that take a "text" parameter which is nothing more than a poor-man's enum, or otherwise represents something which isn't actually free text. Perhaps these should use "name" instead, or in some cases an enum type? (or in the case of date_trunc and extract, maybe they need to be split up into separate functions so that we can properly distinguish the immutable from the mutable cases) -- Andrew (irc:RhodiumToad)