Re: Some questions about the array.
| От | Teodor Sigaev |
|---|---|
| Тема | Re: Some questions about the array. |
| Дата | |
| Msg-id | 56586767.6040205@sigaev.ru обсуждение исходный текст |
| Ответ на | Re: Some questions about the array. (YUriy Zhuravlev <u.zhuravlev@postgrespro.ru>) |
| Ответы |
Re: Some questions about the array.
|
| Список | pgsql-hackers |
Some comments about patch
1
Documentation isn't very informative
Outputs of
SELECT schedule[:][:] FROM sal_emp WHERE name = 'Bill'
and
SELECT schedule[:2][1:] FROM sal_emp WHERE name = 'Bill';
are the same. Suppose, it's better to have differs ones.
2
# create table xxx (a int[]);
# update xxx set a[2:] = '{1,2}';
UPDATE 0
# update xxx set a[2:] = '{1,2}';
ERROR: cannot determine upper index for empty array
# update xxx set a[:2] = '{1,2}';
ERROR: invalid input syntax for integer: "{1,2}"
# update xxx set a[:] = '{1,2}';
ERROR: invalid input syntax for integer: "{1,2}"
Seems, error messages are too inconsistent. If you forbid omitting bound in
assigment then if all cases error message should be the same or close.
YUriy Zhuravlev wrote:
> Hello again.
> I attached simple patch for omitted boundaries in the slice.
> This will simplify the writing of SQL. Instead:
> select arr[2:array_upper(arr, 1)];
> you can write:
> select arr[2:];
>
> simple and elegant.
> Omitted boundaries is prohibited in UPDATE.
>
> Thanks.
>
>
>
>
--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/
В списке pgsql-hackers по дате отправления: