Re: BUG #17664: The subsctring() function with the char() text type does not work correctly

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #17664: The subsctring() function with the char() text type does not work correctly
Дата
Msg-id CAKFQuwbpJ42W5fX7PYRsmx+3Q+G-e3G5buyMjxUB0r+0av2-qg@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #17664: The subsctring() function with the char() text type does not work correctly  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs


On Thu, Oct 27, 2022 at 5:02 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      17664
Logged by:          Evgenii Timofeev
Email address:      snztim@yandex.ru
PostgreSQL version: 15.0
Operating system:   ALT Linux 10 (ALT Sisyphus 10.3.1)
Description:       

Hi!

If we do the same, but add the substring() function to concat(), the result
will be incorrect (example 2).
As seen in example 2, the function substring(), which should have printed 4
characters, has printed only 3.

Please tell me why the result is not correct?

Because substring only works for text inputs and produces text output so your insignificant whitespace is thrown away if you pass data through that function.

It isn't a bug but a missing feature.  Given that the project basically doesn't recommend people use char this gap in functionality isn't surprising.

David J.

Note that concat is defined polymorphically.

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17666: Unexpected shutdown
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17667: to_char is used to collect statistics by week