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