Array dimension lost if dimension length is zero

Поиск
Список
Период
Сортировка
От Shay Rojansky
Тема Array dimension lost if dimension length is zero
Дата
Msg-id CADT4RqDaXBuConyhNiPHPqASFxZWOFYYJsY_=DW03=+2H_-xwg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Array dimension lost if dimension length is zero
Список pgsql-bugs
An Npgsql user has reported an edge case use which seems to be a bug.

When sending a multidimensional array to PostgreSQL, if the length of a
dimension is 0, that dimension is lost. That is, the user sends a
2-dimensional array with 0 for both dimensions; trying to read this back
will return a 1-dimensional array.

It seems that another way to see this problem is this... Running "select
ARRAY[[1], [1]]::integer[]" returns "{{1},{1}}". However, running "select
ARRAY[[], []]::integer[]" returns "{}".

It seems important for the dimensionality of the array to be what was sent
regardless of the lengths; otherwise problems occur as the user expect back
a 2-dimensional array but receive a single-dimensional one...

For reference, the original issue is
https://github.com/npgsql/npgsql/issues/1271

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14317: psql \dt not working as expected
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Array dimension lost if dimension length is zero