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

2015-12-28 Thread Michael Rasmussen
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||

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

2015-12-28 Thread Tom Lane
"David G. Johnston" 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

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

2015-12-28 Thread David G. Johnston
On Mon, Dec 28, 2015 at 4:39 PM, Tom Lane wrote: > Michael Rasmussen writes: > > I am trying to iterate through a multidimensional array using a foreach > loop, as exampled in the documentation at > http://www.postgresql.org/docs/9.4/static/plpgsql-control-structures.html#PLPGSQL-FOREACH-ARRAY >

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

2015-12-28 Thread David G. Johnston
On Mon, Dec 28, 2015 at 4:05 PM, Michael Rasmussen wrote: > Hello, I’m running 9.4.5 locally on my mac doing some plpgsql development. > > I am trying to iterate through a multidimensional array using a foreach > loop, as exampled in the documentation at > http://www.postgresql.org/docs/9.4/stati

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

2015-12-28 Thread Tom Lane
Michael Rasmussen writes: > I am trying to iterate through a multidimensional array using a foreach loop, > as exampled in the documentation at > http://www.postgresql.org/docs/9.4/static/plpgsql-control-structures.html#PLPGSQL-FOREACH-ARRAY. > Here is a simplified version of the function: > C

[GENERAL] plpgsql multidimensional array assignment results in array of text instead of subarrays

2015-12-28 Thread Michael Rasmussen
Hello, I’m running 9.4.5 locally on my mac doing some plpgsql development. I am trying to iterate through a multidimensional array using a foreach loop, as exampled in the documentation at http://www.postgresql.org/docs/9.4/static/plpgsql-control-structures.html#PLPGSQL-FOREACH-ARRAY. Here is a

[GENERAL] Plpgsql Multidimensional array

2006-06-06 Thread Rodrigo Carvalhaes
Hi! I need to make a plpgsql function and I only think on a multidimensional array to make this function BUT I know that multidimensional arrays are not supported in plpgsql so, I wanna to receive some ideas from this list. Our system have a proprietary way to make his "ENCODING" , for exampl