Re: plpgsql multidimensional array assignment results in array of text instead of subarrays - Mailing list pgsql-general

From Michael Rasmussen
Subject Re: plpgsql multidimensional array assignment results in array of text instead of subarrays
Date
Msg-id D32BBA79-54D1-44E3-8DCD-F3FEFA1FA386@porch.com
Whole thread Raw
In response to Re: plpgsql multidimensional array assignment results in array of text instead of subarrays  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql multidimensional array assignment results in array of text instead of subarrays
Next
From: Hiroyuki Sato
Date:
Subject: Re: grep -f keyword data query