Re: plpgsql multidimensional array assignment results in array of text instead of subarrays

Поиск
Список
Период
Сортировка
От Michael Rasmussen
Тема Re: plpgsql multidimensional array assignment results in array of text instead of subarrays
Дата
Msg-id D32BBA79-54D1-44E3-8DCD-F3FEFA1FA386@porch.com
обсуждение исходный текст
Ответ на Re: plpgsql multidimensional array assignment results in array of text instead of subarrays  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Thank you all for your help.

I currently only have the two cases to handle, so I went with the below if-else statement which works how I expected.

    -- Generate array of tables to create
    if (create_source) then
    the_tables := array[[new_table_schema, new_table_name],[new_table_schema||'_source', new_table_name||'_source']];
    else
    the_tables := array[[new_table_schema, new_table_name]];
    end if;


-- 
Michael Rasmussen

Sr. Data Engineer
Porch






On 12/28/15, 3:51 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

>"David G. Johnston" <david.g.johnston@gmail.com> writes:
>> ​or a more semantically meaning one...the use of the inner array is
>> arguably a hack here meant to avoid the overhead and new type creation by
>> assigning meaning to array slots.
>
>Yeah, good point: it looks like Mike does not consider the columns of
>the array to be interchangeable at all, so really he would be better
>off modeling the data as you suggest.
>
>            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: plpgsql multidimensional array assignment results in array of text instead of subarrays
Следующее
От: Hiroyuki Sato
Дата:
Сообщение: Re: grep -f keyword data query