From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Michael Rasmussen <michaelr(at)porch(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: plpgsql multidimensional array assignment results in array of text instead of subarrays |
Date: | 2015-12-28 23:48:32 |
Message-ID: | CAKFQuwaUDFarr5Zs287Cnm35dVPSzSSs3jCSG6O_vqqTu3y6WA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, Dec 28, 2015 at 4:39 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Michael Rasmussen <michaelr(at)porch(dot)com> 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
> .
>
> create type textarray as (t text[]);
>
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.
i.e.,
create type table_with_schema (name text, schema text);
I would likewise attempt to do away with the outer array as well if the
overall structure of the example follows reality closely enough.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2015-12-28 23:51:50 | Re: plpgsql multidimensional array assignment results in array of text instead of subarrays |
Previous Message | David G. Johnston | 2015-12-28 23:41:15 | Re: plpgsql multidimensional array assignment results in array of text instead of subarrays |