Re: BUG #14800: substring produces different results with similar types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Francisco Olarte <folarte(at)peoplecall(dot)com>
Cc: kostin(dot)artem(at)gmail(dot)com, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14800: substring produces different results with similar types
Date: 2017-09-06 14:51:02
Message-ID: 30250.1504709462@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Francisco Olarte <folarte(at)peoplecall(dot)com> writes:
> Anyway, you may notice char() discards trailing blanks, varchar does not:

More precisely, converting from char(n) to varchar or text discards
trailing blanks. Since both substring() and the || operator take
text argument types, an implicit coercion to text is happening in
these examples ... and that's where the blanks went.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Артём Костин 2017-09-06 15:22:16 Re: BUG #14800: substring produces different results with similar types
Previous Message Francisco Olarte 2017-09-06 14:12:41 Re: BUG #14800: substring produces different results with similar types