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).