Re: [PATCHES] [BUGS] casting strings to multidimensional arrays yields

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: [PATCHES] [BUGS] casting strings to multidimensional arrays yields
Дата
Msg-id 4112C895.4090904@joeconway.com
обсуждение исходный текст
Ответ на Re: [BUGS] casting strings to multidimensional arrays yields strange results  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCHES] [BUGS] casting strings to multidimensional arrays yields strange  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Joe Conway wrote:
> I'm hesitant to apply the attached this late before the beta without 
> review, but it seems to take care of the pathological cases I came up 
> with, doesn't break anything AFAICS, and passes all regression tests. I 
> guess it can go into beta 2.

I've continued to hack on array literal parsing today, and in doing so 
came up with a question regarding behavior. Currently the following works:

regression=# select '{0 second,0 second}'::interval[];      interval
--------------------- {00:00:00,00:00:00}
(1 row)

However, since we don't require an element with embedded spaces to be 
quoted, it also means that whitespace just before the delimiter is 
significant (even though leading whitespace is not) because there is no 
way to know when the element is complete:

regression=# select '{   0 second   ,0 second}'::text[];            text
---------------------------- {"0 second   ","0 second"}
(1 row)


I view the current behavior as a bug. While making changes, I'd like to 
require elements with embedded whitespace to be quoted so that the above 
does this:

regression=# select '{0 second,0 second}'::text[];
ERROR:  malformed array literal: "{0 second,0 second}"

Additionally I'd like to make whitespace before and after quoted or 
unquoted elements insignificant. Any comments?

Thanks,

Joe


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

Предыдущее
От: "Hicham G. Elmongui"
Дата:
Сообщение: OidFunctionCall4
Следующее
От: Tom Lane
Дата:
Сообщение: 8.0 beta status