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

From: Артём Костин <kostin(dot)artem(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Francisco Olarte <folarte(at)peoplecall(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 15:22:16
Message-ID: CALQQPTeL=9syDfDEO=wRs8u-vYwV3WP9t2bLVt85Ph4OhQ8hMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

But documentation says different. So this behaviour is unxpected.

6 сент. 2017 г. 5:51 PM пользователь "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> написал:

> 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 Tom Lane 2017-09-06 15:37:26 Re: BUG #14800: substring produces different results with similar types
Previous Message Tom Lane 2017-09-06 14:51:02 Re: BUG #14800: substring produces different results with similar types