| От | Tom Lane |
|---|---|
| Тема | Re: Array behavior oddities |
| Дата | |
| Msg-id | 24814.1200414847@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Array behavior oddities (Gregory Stark <stark@enterprisedb.com>) |
| Список | pgsql-hackers |
Gregory Stark <stark@enterprisedb.com> writes:
> Here's something else which confused me just now. Why does the second query
> return NULL instead of an array slice?
Because it isn't a slice expression --- you used colon nowhere, so the
result type is going to be text not text[]. (Remember that the parser
must determine the expression's result type at parse time, so whether
there are enough subscripts can't enter into this.) Our alternatives
here are to throw a subscripting error or return NULL. I'd personally
have gone with throwing an error, I think, but it seems far too late to
revisit that decision.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера