Re: [BUGS] BUG #14693: create materialized view forces btrim - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: [BUGS] BUG #14693: create materialized view forces btrim
Date
Msg-id CAKFQuwYRsoR8jtb6kw_BRzUNJqo2wkQ_p+xGV=XhTdSHECZHGw@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14693: create materialized view forces btrim  (Ian Boardman <isb0459@gmail.com>)
Responses Re: [BUGS] BUG #14693: create materialized view forces btrim  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Tue, Jun 6, 2017 at 2:40 PM, Ian Boardman <isb0459@gmail.com> wrote:
Thanks very much folks. For your entertainment, this seems to be working. I changed the expression to  trim(from foo) || bar,  in my select statement, and reliably got a non-empty result.

​So does "SELECT 'a non empty value';"...I guess if you're happy, great, but your solution and the original problem look nothing alike.​

  I committed this via "create materialized view", and inspected what Postgres did with it (\dSm+). It still is stored as btrim(foo) || bar; and yet, it works correctly(?!) 

​I don't know why btrim is the canonical spelling of the trim function but, like Tom said, it is.​  The choice of btrim or trim will not influence the end result of the query in any way (though I don't think btrim accepts the "from" keyword that trim does).

David J.

pgsql-bugs by date:

Previous
From: Mike Palmiotto
Date:
Subject: Re: [BUGS] BUG #14682: row level security not work with partitioned table
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14693: create materialized view forces btrim