Re: BUG #17450: SUBSTRING function extracting lesser characters than specified
В списке pgsql-bugs по дате отправления:
| От | hubert depesz lubaczewski |
|---|---|
| Тема | Re: BUG #17450: SUBSTRING function extracting lesser characters than specified |
| Дата | |
| Msg-id | 20220328110119.GA28018@depesz.com обсуждение |
| Ответ на | BUG #17450: SUBSTRING function extracting lesser characters than specified (PG Bug reporting form <noreply@postgresql.org>) |
| Ответы |
Re: BUG #17450: SUBSTRING function extracting lesser characters than specified
|
| Список | pgsql-bugs |
On Mon, Mar 28, 2022 at 10:30:07AM +0000, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 17450
> Logged by: Suman Ganguly
> Email address: ganguly.04@gmail.com
> PostgreSQL version: 10.17
> Operating system: x86_64-pc-linux-gnu
> Description:
>
> select substring('123456', 0 , 5)
> On running this, Postgres returns '1234'
> Expecting '12345' to be returned as per the documentation
Well, the problem is that you're trying to provide character number 0,
which is leading to bad results.
substring works on base-1 numbering.
depesz
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера