Re: Getting sorted data from foreign server - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Getting sorted data from foreign server
Date
Msg-id CA+TgmoZj=W5o-dKqAOHMxGnUhm+P-TLJtSN8CJzu4AQ_=GJgUg@mail.gmail.com
Whole thread Raw
In response to Re: Getting sorted data from foreign server  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Responses Re: Getting sorted data from foreign server  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers
On Fri, Oct 30, 2015 at 6:19 AM, Ashutosh Bapat
<ashutosh.bapat@enterprisedb.com> wrote:
> If there is a collate clause in the ORDER BY, the server crashes with
> assertion
> +    Assert(loc_cxt.state == FDW_COLLATE_NONE ||
> +            loc_cxt.state == FDW_COLLATE_SAFE);
>
>
> The assertion is fine as long as is_foreign_expr() tests only boolean
> expressions (appearing in quals). This patch uses the function to test an
> expression appearing in ORDER BY clause, which need not be boolean. Attached
> patch removed the assertion and instead makes the function return false,
> when the walker deems collation of the expression unsafe. The walker can not
> return false when it encounter unsafe expression since the subtree it's
> examining might be part of an expression which does not use the collation
> ultimately.

I've committed this version.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: September 2015 Commitfest
Next
From: Neil Tiffin
Date:
Subject: Re: [patch] to build docs on Mac OS X El Capitan with MacPorts