Re: generic way to retrieve array as rowset

From: SunWuKung <Balazs(dot)Klein(at)axelero(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: generic way to retrieve array as rowset
Date: 2006-01-03 16:36:54
Message-ID: MPG.1e24c6927bb966f9989684@news.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you both, I will make good use of this.

On a side note: isn't it a pity this has to be so difficult?

Balázs

In article <20060103151044(dot)GF9478(at)webserv(dot)wug-glas(dot)de>,
andreas(dot)kretschmer(at)schollglas(dot)com says...
> am 03.01.2006, um 16:42:08 +0200 mailte Volkan YAZICI folgendes:
> > Hi,
> >
> > Here's a modified version of A. Kretschmer's answer. This one checks
> > array_upper() sizes and depending on it, doesn't provide unnecessary
> > NULL fields. HTH.
> >
> > SELECT id, val[s.i]
> > FROM t7
> > LEFT JOIN
> > (SELECT g.s
> > FROM generate_series(1,
> > (SELECT max(array_upper(val, 1)) FROM t7)) AS g(s)
> > ) AS s(i)
> > ON (s.i <= array_upper(val, 1));
>
> Cool ;-)
>
>
> Andreas
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc Munro 2006-01-03 16:41:57 Re: I want to know how to improve the security of postgresql
Previous Message Albert Vernon Smith 2006-01-03 16:25:43 Re: insert serial numbers