Re: The result of the pattern matching is incorrect when the pattern string is bpchar type

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: 甄明洋 <zhenmingyang(at)yeah(dot)net>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: The result of the pattern matching is incorrect when the pattern string is bpchar type
Date: 2019-07-11 17:26:52
Message-ID: 87k1co4hfu.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>>>>> "David" == David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com> writes:

>> There are two tables with the type of column is char. when Using a
>> 'like' predicate in a join condition will result in an incorrect
>> result. Because there is no 'like' operator that left operand and
>> right operand are all bpchar.(bpchar ~~ bpchar), final the operator
>> 'bpchar ~~ text' will be found form candidate set. so database do
>> the cast from bpchar to text, The space at the end of the string was
>> removed during the cast.

David> A similar complaint was made the other day; Tom's response
David> succinctly sums up the prevailing opinion as to the character
David> type.

It's also listed as WONTFIX here:

https://wiki.postgresql.org/wiki/PostgreSQL_vs_SQL_Standard#Trailing_spaces_in_character.28n.29

though I guess adding the LIKE case as an example there might be good.

--
Andrew (irc:RhodiumToad)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-07-11 21:20:07 Re: ERROR: found unexpected null value in index
Previous Message David G. Johnston 2019-07-11 16:45:42 Re: BUG #15904: ERROR: argument of LIMIT must not contain variables