Re: [BUGS] BUG #14800: substring produces different results withsimilar types

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [BUGS] BUG #14800: substring produces different results withsimilar types
Дата
Msg-id CAKFQuwb75rbbifwgOqHSMxmgh2_OAr6179Y+OYtxfczuZ=roCQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #14800: substring produces different results withsimilar types  (Артём Костин <kostin.artem@gmail.com>)
Список pgsql-bugs
On Wed, Sep 6, 2017 at 10:10 AM, Артём Костин <kostin.artem@gmail.com> wrote:
I'm sorry for this approach.

The main point is that behaviour are not applied to all character types described in docs. You can see it in my example.

​There is only one "character type" in PostgreSQL, it is spelled "character" (char is a valid alias).


For the second point, please, check chapter 8.3 for this
"Trailing spaces are removed when converting a character value to one of the other string types. Note that trailing spaces are semantically significant in character varying and text values, and when using pattern matching, that is LIKE and regular expressions."


IOW, ​The "character" data type is one of three "string-class" types in the PostgreSQL system.  "character" has no concept of "semantically significant trailing whitespace".  Therefore when converting from "character" to one of the other two "string-class" types (varchar, text) you will never end up with a resultant value with trailing whitespace.

​David J.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Wood, Dan"
Дата:
Сообщение: Re: [BUGS] Old row version in hot chain become visible after a freeze
Следующее
От: Patrick van Coeverden
Дата:
Сообщение: [BUGS] Line number in error message is incorrect when loading a CSV-filewith multi-line records.