Dynamic multi dimensional arrays in SQL

Поиск
Список
Период
Сортировка
От Dane Foster
Тема Dynamic multi dimensional arrays in SQL
Дата
Msg-id CA+Wxin+_-sGtSFbXQNrEQqAV6xw3z4qKhPchT+jhPz_wetUC=A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Dynamic multi dimensional arrays in SQL  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
Hello,

I'm trying to dynamically construct a multi dimensional array where the outer most array's elements are binary arrays. My initial attempt was something to the effect of:
SELECT ARRAY(SELECT ARRAY[true::text,false::text] FROM generate_series(1,2));

My expectation is a result of the form: {{true,false},{true,false}}

But it doesn't work. I get the following error instead: "could not find array type for data type text[]".

The only way I've gotten it to work is to concatenate strings and explicitly cast the string to an array. It's ugly. I'm hoping the issue is that I'm doing something wrong and not that string concatenation or a procedural language are the only solutions.

Any insight into what I'm doing wrong would be appreciated.

Regards,

Dane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to test SSL cert from CA?
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Dynamic multi dimensional arrays in SQL