Re: [BUGS] BUG #14800: substring produces different results withsimilar types
От | Francisco Olarte |
---|---|
Тема | Re: [BUGS] BUG #14800: substring produces different results withsimilar types |
Дата | |
Msg-id | CA+bJJbygqhGsFqPG7sf4wmk3fn6D00GsD5dFpuFithLeMo-M8Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [BUGS] BUG #14800: substring produces different results with similar types (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-bugs |
Tom: On Wed, Sep 6, 2017 at 4:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Francisco Olarte <folarte@peoplecall.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. I was suspecting that, but https://www.postgresql.org/docs/9.6/static/functions-string.html documents them as "string || string", returns text, and "substring(string {several variants})", returns text and trying to look where the conversion to text happened ( i.e., in the arguments, or after aplying overloaded variants ) seemed a bit extreme. Not surprising, anyway, of the space chopping, having worked with punched cards I'm used to it. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs
В списке pgsql-bugs по дате отправления: